📄 gtkaction.html
字号:
<td> the action object</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the accel path for this action, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if none is set. The returned string is owned by GTK+ and must not be freed or modified.</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3983719"></a><h3><a name="gtk-action-set-accel-path"></a>gtk_action_set_accel_path ()</h3><a class="indexterm" name="id3983735"></a><pre class="programlisting">void gtk_action_set_accel_path (<a class="link" href="GtkAction.html" title="GtkAction">GtkAction</a> *action, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *accel_path);</pre><p>Sets the accel path for this action. All proxy widgets associatedwith the action will have this accel path, so that theiraccelerators are consistent.</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>action</code></em> :</span></p></td><td> the action object</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td><td> the accelerator path</td></tr></tbody></table></div><p class="since">Since 2.4</p></div><hr><div class="refsect2" lang="en"><a name="id3983816"></a><h3><a name="gtk-action-get-accel-closure"></a>gtk_action_get_accel_closure ()</h3><a class="indexterm" name="id3983832"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/gobject/gobject-Closures.html#GClosure">GClosure</a>* gtk_action_get_accel_closure (<a class="link" href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre><p>Returns the accel closure for this action.</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>action</code></em> :</span></p></td><td> the action object</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified.</td></tr></tbody></table></div><p class="since">Since 2.8</p></div><hr><div class="refsect2" lang="en"><a name="id3983901"></a><h3><a name="gtk-action-set-accel-group"></a>gtk_action_set_accel_group ()</h3><a class="indexterm" name="id3983918"></a><pre class="programlisting">void gtk_action_set_accel_group (<a class="link" href="GtkAction.html" title="GtkAction">GtkAction</a> *action, <a class="link" href="gtk-Keyboard-Accelerators.html#GtkAccelGroup">GtkAccelGroup</a> *accel_group);</pre><p>Sets the <a class="link" href="gtk-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> in which the accelerator for this actionwill be installed.</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>action</code></em> :</span></p></td><td> the action object</td></tr><tr><td><p><span class="term"><em class="parameter"><code>accel_group</code></em> :</span></p></td><td> a <a class="link" href="gtk-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> 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></div><div class="refsect1" lang="en"><a name="id3984024"></a><h2>Property Details</h2><div class="refsect2" lang="en"><a name="id3984035"></a><h3><a name="GtkAction--action-group"></a>The <code class="literal">"action-group"</code> property</h3><a class="indexterm" name="id3984052"></a><pre class="programlisting"> "action-group" <a class="link" href="GtkActionGroup.html" title="GtkActionGroup">GtkActionGroup</a> : Read / Write</pre><p>The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).</p></div><hr><div class="refsect2" lang="en"><a name="id3984076"></a><h3><a name="GtkAction--hide-if-empty"></a>The <code class="literal">"hide-if-empty"</code> property</h3><a class="indexterm" name="id3984092"></a><pre class="programlisting"> "hide-if-empty" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>When TRUE, empty menu proxies for this action are hidden.</p><p>Default value: TRUE</p></div><hr><div class="refsect2" lang="en"><a name="id3984120"></a><h3><a name="GtkAction--icon-name"></a>The <code class="literal">"icon-name"</code> property</h3><a class="indexterm" name="id3984136"></a><pre class="programlisting"> "icon-name" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write</pre><p>The name of the icon from the icon theme. Note that the stock icon is preferred, ifthe ::stock-id property holds the id of anexisting stock icon.</p><p></p><p>Default value: NULL</p><p>Since 2.10</p></div><hr><div class="refsect2" lang="en"><a name="id3984173"></a><h3><a name="GtkAction--is-important"></a>The <code class="literal">"is-important"</code> property</h3><a class="indexterm" name="id3984189"></a><pre class="programlisting"> "is-important" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.</p><p>Default value: FALSE</p></div><hr><div class="refsect2" lang="en"><a name="id3984218"></a><h3><a name="GtkAction--label"></a>The <code class="literal">"label"</code> property</h3><a class="indexterm" name="id3984233"></a><pre class="programlisting"> "label" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write</pre><p>The label used for menu items and buttons that activatethis action. If the label is <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>, GTK+ uses the stock label specified via the stock-id property.</p><p></p><p>Default value: NULL</p></div><hr><div class="refsect2" lang="en"><a name="id3984276"></a><h3><a name="GtkAction--name"></a>The <code class="literal">"name"</code> property</h3><a class="indexterm" name="id3984292"></a><pre class="programlisting"> "name" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write / Construct Only</pre><p>A unique name for the action.</p><p>Default value: NULL</p></div><hr><div class="refsect2" lang="en"><a name="id3984319"></a><h3><a name="GtkAction--sensitive"></a>The <code class="literal">"sensitive"</code> property</h3><a class="indexterm" name="id3984336"></a><pre class="programlisting"> "sensitive" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>Whether the action is enabled.</p><p>Default value: TRUE</p></div><hr><div class="refsect2" lang="en"><a name="id3984363"></a><h3><a name="GtkAction--short-label"></a>The <code class="literal">"short-label"</code> property</h3><a class="indexterm" name="id3984378"></a><pre class="programlisting"> "short-label" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write</pre><p>A shorter label that may be used on toolbar buttons.</p><p>Default value: NULL</p></div><hr><div class="refsect2" lang="en"><a name="id3984405"></a><h3><a name="GtkAction--stock-id"></a>The <code class="literal">"stock-id"</code> property</h3><a class="indexterm" name="id3984421"></a><pre class="programlisting"> "stock-id" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write</pre><p>The stock icon displayed in widgets representing this action.</p><p>Default value: NULL</p></div><hr><div class="refsect2" lang="en"><a name="id3984448"></a><h3><a name="GtkAction--tooltip"></a>The <code class="literal">"tooltip"</code> property</h3><a class="indexterm" name="id3984464"></a><pre class="programlisting"> "tooltip" <ahref="/usr/share/gtk-doc/html/gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray">gchararray</a> : Read / Write</pre><p>A tooltip for this action.</p><p>Default value: NULL</p></div><hr><div class="refsect2" lang="en"><a name="id3984490"></a><h3><a name="GtkAction--visible"></a>The <code class="literal">"visible"</code> property</h3><a class="indexterm" name="id3984506"></a><pre class="programlisting"> "visible" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>Whether the action is visible.</p><p>Default value: TRUE</p></div><hr><div class="refsect2" lang="en"><a name="id3984532"></a><h3><a name="GtkAction--visible-horizontal"></a>The <code class="literal">"visible-horizontal"</code> property</h3><a class="indexterm" name="id3984550"></a><pre class="programlisting"> "visible-horizontal" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>Whether the toolbar item is visible when the toolbar is in a horizontal orientation.</p><p>Default value: TRUE</p></div><hr><div class="refsect2" lang="en"><a name="id3984577"></a><h3><a name="GtkAction--visible-overflown"></a>The <code class="literal">"visible-overflown"</code> property</h3><a class="indexterm" name="id3984594"></a><pre class="programlisting"> "visible-overflown" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>When <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, toolitem proxies for this action are represented in the toolbar overflow menu.</p><p></p><p>Default value: TRUE</p><p>Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3984641"></a><h3><a name="GtkAction--visible-vertical"></a>The <code class="literal">"visible-vertical"</code> property</h3><a class="indexterm" name="id3984658"></a><pre class="programlisting"> "visible-vertical" <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> : Read / Write</pre><p>Whether the toolbar item is visible when the toolbar is in a vertical orientation.</p><p>Default value: TRUE</p></div></div><div class="refsect1" lang="en"><a name="id3984686"></a><h2>Signal Details</h2><div class="refsect2" lang="en"><a name="id3984697"></a><h3><a name="GtkAction-activate"></a>The <code class="literal">"activate"</code> signal</h3><a class="indexterm" name="id3984713"></a><pre class="programlisting">void user_function (<a class="link" href="GtkAction.html" title="GtkAction">GtkAction</a> *action, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer">gpointer</a> user_data) : Run First / No Recursion</pre><p>The "activate" signal is emitted when the action is activated.</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>action</code></em> :</span></p></td><td> the <a class="link" href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a></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><p>Since 2.4</p></div></div><div class="refsect1" lang="en"><a name="id3984799"></a><h2>See Also</h2><p><a class="link" href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a>, <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a></p></div><div class="refsect1" lang="en"><a name="id3984825"></a><div class="refsect2" lang="en"><a name="id3984826"></a></div><hr><div class="refsect2" lang="en"><a name="id3984828"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -