📄 gtktoggletoolbutton.html
字号:
</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3954897"></a><h3><a name="gtk-toggle-tool-button-new-from-stock"></a>gtk_toggle_tool_button_new_from_stock ()</h3><a class="indexterm" name="id3954913"></a><pre class="programlisting"><a class="link" href="GtkToolItem.html" title="GtkToolItem">GtkToolItem</a>* gtk_toggle_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="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</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="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</span></a></td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3955027"></a><h3><a name="gtk-toggle-tool-button-set-active"></a>gtk_toggle_tool_button_set_active ()</h3><a class="indexterm" name="id3955044"></a><pre class="programlisting">void gtk_toggle_tool_button_set_active (<a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton">GtkToggleToolButton</a> *button, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> is_active);</pre><p>Sets the status of the toggle tool button. Set to <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if youwant the GtkToggleButton to be 'pressed in', and <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to raise it.This action causes the toggled signal to be emitted.</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="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>is_active</code></em> :</span></p></td><td> whether <em class="parameter"><code>button</code></em> should be active</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3955159"></a><h3><a name="gtk-toggle-tool-button-get-active"></a>gtk_toggle_tool_button_get_active ()</h3><a class="indexterm" name="id3955176"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> gtk_toggle_tool_button_get_active (<a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton">GtkToggleToolButton</a> *button);</pre><p>Queries a <a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</span></a> and returns its current state.Returns <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the toggle button is pressed in and <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if it is raised.</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="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</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 the toggle tool button is pressed in, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if not</td></tr></tbody></table></div><p class="since">Since 2.4</p></div></div><div class="refsect1" lang="en"><a name="id3955302"></a><h2>Property Details</h2><div class="refsect2" lang="en"><a name="id3955313"></a><h3><a name="GtkToggleToolButton--active"></a>The <code class="literal">"active"</code> property</h3><a class="indexterm" name="id3955329"></a><pre class="programlisting"> "active" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>If the toggle tool button should be pressed in or not.</p><p></p><p>Default value: FALSE</p><p>Since 2.8</p></div></div><div class="refsect1" lang="en"><a name="id3955367"></a><h2>Signal Details</h2><div class="refsect2" lang="en"><a name="id3955377"></a><h3><a name="GtkToggleToolButton-toggled"></a>The <code class="literal">"toggled"</code> signal</h3><a class="indexterm" name="id3955393"></a><pre class="programlisting">void user_function (<a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton">GtkToggleToolButton</a> *toggle_tool_button, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data) : Run First</pre><p>Emitted whenever the toggle tool button changes state.</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>toggle_tool_button</code></em> :</span></p></td><td> the object that emitted the signal</td></tr><tr><td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td><td>user data set when the signal handler was connected.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3955469"></a><h2>See Also</h2><p> <dt><span class="term"><a class="link" href="GtkToolbar.html" title="GtkToolbar"><span class="type">GtkToolbar</span></a>, </span><span class="term"><a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a>, </span><span class="term"><a class="link" href="GtkSeparatorToolItem.html" title="GtkSeparatorToolItem"><span class="type">GtkSeparatorToolItem</span></a></span></dt><dd><p>The toolbar widget</p><p> The parent class of <a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</span></a>. The properties "label_widget", "label", "icon_widget", and "stock_id" on <a class="link" href="GtkToolButton.html" title="GtkToolButton"><span class="type">GtkToolButton</span></a> determine the label and icon used on <a class="link" href="GtkToggleToolButton.html" title="GtkToggleToolButton"><span class="type">GtkToggleToolButton</span></a>s. </p><p>A subclass of <a class="link" href="GtkToolItem.html" title="GtkToolItem"><span class="type">GtkToolItem</span></a> that separates groups of items on a toolbar. </p></dd></p></div><div class="refsect1" lang="en"><a name="id3955565"></a><div class="refsect2" lang="en"><a name="id3955566"></a></div><hr><div class="refsect2" lang="en"><a name="id3955567"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -