📄 gtktoolbutton.html
字号:
</p><p>The icon of a <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a> is determined by the properties"icon_widget" and "stock_id". If "icon_widget" is non-<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, thenthat widget is used as the icon. Otherwise, if "stock_id" isnon-<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, the icon is determined by the stock item. Otherwise,the button does not have a label.</p></div><div class="refsect1" lang="en"><a name="id3945095"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3945106"></a><h3><a name="GtkToolButton-struct"></a>GtkToolButton</h3><a class="indexterm" name="id3945119"></a><pre class="programlisting">typedef struct _GtkToolButton GtkToolButton;</pre><p>The <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a> struct contains only private. It should only beaccessed with the function described below.</p></div><hr><div class="refsect2" lang="en"><a name="id3945144"></a><h3><a name="gtk-tool-button-new"></a>gtk_tool_button_new ()</h3><a class="indexterm" name="id3945159"></a><pre class="programlisting"><a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a>* gtk_tool_button_new (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *icon_widget, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *label);</pre><p>Creates a new <a class="link" href="GtkToolButton.html" title="GtkToolButton"><code class="literal">GtkToolButton</code></a> using <em class="parameter"><code>icon_widget</code></em> as icon and <em class="parameter"><code>label</code></em> aslabel.</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>icon_widget</code></em> :</span></p></td><td> a widget that will be used as icon widget, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td><td> a string that will be used as label, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A new <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3945300"></a><h3><a name="gtk-tool-button-new-from-stock"></a>gtk_tool_button_new_from_stock ()</h3><a class="indexterm" name="id3945316"></a><pre class="programlisting"><a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a>* gtk_tool_button_new_from_stock (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id);</pre><p>Creates a new <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a> containing the image and text from astock item. Some stock ids have preprocessor macros like <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-OK:CAPS"><span class="type">GTK_STOCK_OK</span></a>and <a class="link" href="gtk-Stock-Items.html#GTK-STOCK-APPLY:CAPS"><span class="type">GTK_STOCK_APPLY</span></a>.</p><p>It is an error if <em class="parameter"><code>stock_id</code></em> is not a name of a stock item.</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>stock_id</code></em> :</span></p></td><td> the name of the stock item </td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> A new <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3945429"></a><h3><a name="gtk-tool-button-set-label"></a>gtk_tool_button_set_label ()</h3><a class="indexterm" name="id3945445"></a><pre class="programlisting">void gtk_tool_button_set_label (<a class="link" href="GtkToolButton.html" title="GtkToolButton">GtkToolButton</a> *button, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *label);</pre><p>Sets <em class="parameter"><code>label</code></em> as the label used for the tool button. The "label" propertyonly has an effect if not overridden by a non-<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> "label_widget" property.If both the "label_widget" and "label" properties are <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, the labelis determined by the "stock_id" property. If the "stock_id" property is also<ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>button</code></em> will not have a label.</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>button</code></em> :</span></p></td><td> a <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td><td> a string that will be used as label, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3945588"></a><h3><a name="gtk-tool-button-get-label"></a>gtk_tool_button_get_label ()</h3><a class="indexterm" name="id3945604"></a><pre class="programlisting">const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a>* gtk_tool_button_get_label (<a class="link" href="GtkToolButton.html" title="GtkToolButton">GtkToolButton</a> *button);</pre><p>Returns the label used by the tool button, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if the tool buttondoesn't have a label. or uses a the label from a stock item. The returnedstring is owned by GTK+, and must not be modified or freed.</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>button</code></em> :</span></p></td><td> a <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> The label, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3945704"></a><h3><a name="gtk-tool-button-set-use-underline"></a>gtk_tool_button_set_use_underline ()</h3><a class="indexterm" name="id3945721"></a><pre class="programlisting">void gtk_tool_button_set_use_underline (<a class="link" href="GtkToolButton.html" title="GtkToolButton">GtkToolButton</a> *button, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> use_underline);</pre><p>If set, an underline in the label property indicates that the next charactershould be used for the mnemonic accelerator key in the overflow menu. Forexample, if the label property is "_Open" and <em class="parameter"><code>use_underline</code></em> is <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>,the label on the tool button will be "Open" and the item on the overflowmenu will have an underlined 'O'.</p><p>Labels shown on tool buttons never have mnemonics on them; this propertyonly affects the menu item on 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>button</code></em> :</span></p></td><td> a <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>use_underline</code></em> :</span></p></td><td> whether the button label has the form "_Open"</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3945834"></a><h3><a name="gtk-tool-button-get-use-underline"></a>gtk_tool_button_get_use_underline ()</h3><a class="indexterm" name="id3945851"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_tool_button_get_use_underline (<a class="link" href="GtkToolButton.html" title="GtkToolButton">GtkToolButton</a> *button);</pre><p>Returns whether underscores in the label property are used as mnemonicson menu items on the overflow menu. See <a class="link" href="GtkToolButton.html#gtk-tool-button-set-use-underline"><code class="function">gtk_tool_button_set_use_underline()</code></a>.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -