📄 gtktoolitem.html
字号:
<tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>tool_item</code></em> is considered important.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3935664"></a><h3><a name="gtk-tool-item-get-icon-size"></a>gtk_tool_item_get_icon_size ()</h3><a class="indexterm" name="id3935680"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> gtk_tool_item_get_icon_size (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item);</pre><p>Returns the icon size used for <em class="parameter"><code>tool_item</code></em>. Custom subclasses of<a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> should call this function to find out what size iconsthey should use.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSize"><span class="type">GtkIconSize</span></a> indicating the icon size used for <em class="parameter"><code>tool_item</code></em></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3935784"></a><h3><a name="gtk-tool-item-get-orientation"></a>gtk_tool_item_get_orientation ()</h3><a class="indexterm" name="id3935800"></a><pre class="programlisting"><a class="link" href="gtk-Standard-Enumerations.html#GtkOrientation">GtkOrientation</a> gtk_tool_item_get_orientation (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item);</pre><p>Returns the orientation used for <em class="parameter"><code>tool_item</code></em>. Custom subclasses of<a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> should call this function to find out what size iconsthey should use.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span> </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gtk-Standard-Enumerations.html#GtkOrientation"><span class="type">GtkOrientation</span></a> indicating the orientationused for <em class="parameter"><code>tool_item</code></em></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3935905"></a><h3><a name="gtk-tool-item-get-toolbar-style"></a>gtk_tool_item_get_toolbar_style ()</h3><a class="indexterm" name="id3935921"></a><pre class="programlisting"><a class="link" href="gtk-Standard-Enumerations.html#GtkToolbarStyle">GtkToolbarStyle</a> gtk_tool_item_get_toolbar_style (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item);</pre><p>Returns the toolbar style used for <em class="parameter"><code>tool_item</code></em>. Custom subclasses of<a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> should call this function in the handler of theGtkToolItem::toolbar_reconfigured signal to find out in what stylethe toolbar is displayed and change themselves accordingly </p><p>Possibilities are:</p><div class="itemizedlist"><ul type="disc"><li> GTK_TOOLBAR_BOTH, meaning the tool item should showboth an icon and a label, stacked vertically </li><li> GTK_TOOLBAR_ICONS, meaning the toolbar showsonly icons </li><li> GTK_TOOLBAR_TEXT, meaning the tool item should onlyshow text</li><li> GTK_TOOLBAR_BOTH_HORIZ, meaning the tool item should showboth an icon and a label, arranged horizontally (however, note the <span class="type">"has_text_horizontally"</span> that makes tool buttons notshow labels when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ.</li></ul></div><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span> </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A <a class="link" href="gtk-Standard-Enumerations.html#GtkToolbarStyle"><span class="type">GtkToolbarStyle</span></a> indicating the toolbar style usedfor <em class="parameter"><code>tool_item</code></em>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3936065"></a><h3><a name="gtk-tool-item-get-relief-style"></a>gtk_tool_item_get_relief_style ()</h3><a class="indexterm" name="id3936080"></a><pre class="programlisting"><a class="link" href="gtk-Standard-Enumerations.html#GtkReliefStyle">GtkReliefStyle</a> gtk_tool_item_get_relief_style (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item);</pre><p>Returns the relief style of <em class="parameter"><code>tool_item</code></em>. See <code class="function">gtk_button_set_relief_style()</code>.Custom subclasses of <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> should call this function in the handlerof the <a class="link" href="GtkToolItem.html#GtkToolItem-toolbar-reconfigured"><span class="type">"toolbar_reconfigured"</span></a> signal to find out therelief style of buttons.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span> </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gtk-Standard-Enumerations.html#GtkReliefStyle"><span class="type">GtkReliefStyle</span></a> indicating the relief style usedfor <em class="parameter"><code>tool_item</code></em>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3936207"></a><h3><a name="gtk-tool-item-retrieve-proxy-menu-item"></a>gtk_tool_item_retrieve_proxy_menu_item ()</h3><a class="indexterm" name="id3936224"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_tool_item_retrieve_proxy_menu_item (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item);</pre><p>Returns the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> that was last set by<a class="link" href="GtkToolItem.html#gtk-tool-item-set-proxy-menu-item"><code class="function">gtk_tool_item_set_proxy_menu_item()</code></a>, ie. the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>that is going to appear in the overflow menu.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span> </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> The <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> that is going to appear in theoverflow menu for <em class="parameter"><code>tool_item</code></em>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3936342"></a><h3><a name="gtk-tool-item-get-proxy-menu-item"></a>gtk_tool_item_get_proxy_menu_item ()</h3><a class="indexterm" name="id3936359"></a><pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_tool_item_get_proxy_menu_item (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *menu_item_id);</pre><p>If <em class="parameter"><code>menu_item_id</code></em> matches the string passed to<a class="link" href="GtkToolItem.html#gtk-tool-item-set-proxy-menu-item"><code class="function">gtk_tool_item_set_proxy_menu_item()</code></a> return the corresponding <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>.</p><p>Custom subclasses of <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> should use this function to updatetheir menu item when the <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> changes. That the<em class="parameter"><code>menu_item_id</code></em>s must match ensures that a <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> will notinadvertently change a menu item that they did not create.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>tool_item</code></em> :</span></p></td><td> a <span class="type">""</span> </td></tr><tr><td><p><span class="term"><em class="parameter"><code>menu_item_id</code></em> :</span></p></td><td> a string used to identify the menu item</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> The <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> passed to<a class="link" href="GtkToolItem.html#gtk-tool-item-set-proxy-menu-item"><code class="function">gtk_tool_item_set_proxy_menu_item()</code></a>, if the <em class="parameter"><code>menu_item_id</code></em>s match.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3936546"></a><h3><a name="gtk-tool-item-set-proxy-menu-item"></a>gtk_tool_item_set_proxy_menu_item ()</h3><a class="indexterm" name="id3936563"></a><pre class="programlisting">void gtk_tool_item_set_proxy_menu_item (<a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a> *tool_item, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *menu_item_id, <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *menu_item);</pre><p>Sets the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> used in the toolbar overflow menu. The<em class="parameter"><code>menu_item_id</code></em> is used to identify the caller of this function andshould also be used with <a class="link" href="GtkToolItem.html#gtk-tool-item-get-proxy-menu-item"><code class="function">gtk_tool_item_get_proxy_menu_item()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -