1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
<title>GtkAction</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
<link rel="start" href="index.html" title="GTK+ Reference Manual">
8
<link rel="up" href="Actions.html" title="Action-based menus and toolbars">
9
<link rel="prev" href="GtkActionGroup.html" title="GtkActionGroup">
10
<link rel="next" href="GtkToggleAction.html" title="GtkToggleAction">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
14
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
15
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
16
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
17
<link rel="chapter" href="ch02.html" title="Widget Gallery">
18
<link rel="chapter" href="WindowWidgets.html" title="Windows">
19
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
20
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
21
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
22
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
23
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
24
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
25
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
26
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
27
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
28
<link rel="chapter" href="Ornaments.html" title="Ornaments">
29
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
30
<link rel="chapter" href="Printing.html" title="Printing">
31
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
32
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
33
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
34
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
35
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
36
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
37
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
38
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
39
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
40
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
41
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
42
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
43
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
44
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
45
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
46
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
47
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
48
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
49
<link rel="glossary" href="glossary.html" title="Glossary">
50
<link rel="index" href="ix01.html" title="Index">
51
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
52
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
53
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
54
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
55
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
56
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
58
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
59
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
61
<td><a accesskey="p" href="GtkActionGroup.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
62
<td><a accesskey="u" href="Actions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
63
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
64
<th width="100%" align="center">GTK+ Reference Manual</th>
65
<td><a accesskey="n" href="GtkToggleAction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
67
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3436113" class="shortcut">Top</a>
69
<a href="#id3437070" class="shortcut">Description</a>
71
<a href="#id3436752" class="shortcut">Object Hierarchy</a>
73
<a href="#id3436784" class="shortcut">Properties</a>
75
<a href="#id3437042" class="shortcut">Signals</a></nobr></td></tr>
77
<div class="refentry" lang="en">
78
<a name="GtkAction"></a><div class="titlepage"></div>
79
<div class="refnamediv"><table width="100%"><tr>
82
<a name="id3436113"></a><span class="refentrytitle">GtkAction</span>
84
<p>GtkAction — An action which can be triggered by a menu or toolbar item</p>
86
<td valign="top" align="right"></td>
88
<div class="refsynopsisdiv">
90
<pre class="synopsis">
92
#include <gtk/gtk.h>
95
<a href="GtkAction.html#GtkAction-struct">GtkAction</a>;
96
<a href="GtkAction.html" title="GtkAction">GtkAction</a>* <a href="GtkAction.html#gtk-action-new">gtk_action_new</a> (const gchar *name,
99
const gchar *stock_id);
100
const gchar* <a href="GtkAction.html#gtk-action-get-name">gtk_action_get_name</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
101
gboolean <a href="GtkAction.html#gtk-action-is-sensitive">gtk_action_is_sensitive</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
102
gboolean <a href="GtkAction.html#gtk-action-get-sensitive">gtk_action_get_sensitive</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
103
void <a href="GtkAction.html#gtk-action-set-sensitive">gtk_action_set_sensitive</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
105
gboolean <a href="GtkAction.html#gtk-action-is-visible">gtk_action_is_visible</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
106
gboolean <a href="GtkAction.html#gtk-action-get-visible">gtk_action_get_visible</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
107
void <a href="GtkAction.html#gtk-action-set-visible">gtk_action_set_visible</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
109
void <a href="GtkAction.html#gtk-action-activate">gtk_action_activate</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
110
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkAction.html#gtk-action-create-icon">gtk_action_create_icon</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
111
<a href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> icon_size);
112
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkAction.html#gtk-action-create-menu-item">gtk_action_create_menu_item</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
113
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* <a href="GtkAction.html#gtk-action-create-tool-item">gtk_action_create_tool_item</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
114
void <a href="GtkAction.html#gtk-action-connect-proxy">gtk_action_connect_proxy</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
115
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);
116
void <a href="GtkAction.html#gtk-action-disconnect-proxy">gtk_action_disconnect_proxy</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
117
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);
118
GSList* <a href="GtkAction.html#gtk-action-get-proxies">gtk_action_get_proxies</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
119
void <a href="GtkAction.html#gtk-action-connect-accelerator">gtk_action_connect_accelerator</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
120
void <a href="GtkAction.html#gtk-action-disconnect-accelerator">gtk_action_disconnect_accelerator</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
121
void <a href="GtkAction.html#gtk-action-block-activate-from">gtk_action_block_activate_from</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
122
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);
123
void <a href="GtkAction.html#gtk-action-unblock-activate-from">gtk_action_unblock_activate_from</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
124
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);
125
const gchar* <a href="GtkAction.html#gtk-action-get-accel-path">gtk_action_get_accel_path</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
126
void <a href="GtkAction.html#gtk-action-set-accel-path">gtk_action_set_accel_path</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
127
const gchar *accel_path);
128
GClosure* <a href="GtkAction.html#gtk-action-get-accel-closure">gtk_action_get_accel_closure</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);
129
void <a href="GtkAction.html#gtk-action-set-accel-group">gtk_action_set_accel_group</a> (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
130
<a href="gtk-Keyboard-Accelerators.html#GtkAccelGroup">GtkAccelGroup</a> *accel_group);
135
<div class="refsect1" lang="en">
136
<a name="id3436752"></a><h2>Object Hierarchy</h2>
137
<pre class="synopsis">
141
+----<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a>
144
<div class="refsect1" lang="en">
145
<a name="id3436784"></a><h2>Properties</h2>
146
<pre class="synopsis">
148
"<a href="GtkAction.html#GtkAction--action-group">action-group</a>" <a href="GtkActionGroup.html" title="GtkActionGroup">GtkActionGroup</a> : Read / Write
149
"<a href="GtkAction.html#GtkAction--hide-if-empty">hide-if-empty</a>" gboolean : Read / Write
150
"<a href="GtkAction.html#GtkAction--icon-name">icon-name</a>" gchararray : Read / Write
151
"<a href="GtkAction.html#GtkAction--is-important">is-important</a>" gboolean : Read / Write
152
"<a href="GtkAction.html#GtkAction--label">label</a>" gchararray : Read / Write
153
"<a href="GtkAction.html#GtkAction--name">name</a>" gchararray : Read / Write / Construct Only
154
"<a href="GtkAction.html#GtkAction--sensitive">sensitive</a>" gboolean : Read / Write
155
"<a href="GtkAction.html#GtkAction--short-label">short-label</a>" gchararray : Read / Write
156
"<a href="GtkAction.html#GtkAction--stock-id">stock-id</a>" gchararray : Read / Write
157
"<a href="GtkAction.html#GtkAction--tooltip">tooltip</a>" gchararray : Read / Write
158
"<a href="GtkAction.html#GtkAction--visible">visible</a>" gboolean : Read / Write
159
"<a href="GtkAction.html#GtkAction--visible-horizontal">visible-horizontal</a>" gboolean : Read / Write
160
"<a href="GtkAction.html#GtkAction--visible-overflown">visible-overflown</a>" gboolean : Read / Write
161
"<a href="GtkAction.html#GtkAction--visible-vertical">visible-vertical</a>" gboolean : Read / Write
164
<div class="refsect1" lang="en">
165
<a name="id3437042"></a><h2>Signals</h2>
166
<pre class="synopsis">
168
"<a href="GtkAction.html#GtkAction-activate">activate</a>" : Run First / No Recursion
171
<div class="refsect1" lang="en">
172
<a name="id3437070"></a><h2>Description</h2>
174
Actions represent operations that the user can be perform, along with
175
some information how it should be presented in the interface. Each action
176
provides methods to create icons, menu items and toolbar items representing
180
As well as the callback that is called when the action gets activated, the
181
following also gets associated with the action:
183
<div class="itemizedlist"><ul type="disc">
184
<li><p>a name (not translated, for path lookup)</p></li>
185
<li><p>a label (translated, for display)</p></li>
186
<li><p>an accelerator</p></li>
187
<li><p>whether label indicates a stock id</p></li>
188
<li><p>a tooltip (optional, translated)</p></li>
189
<li><p>a toolbar label (optional, shorter than label)</p></li>
192
The action will also have some state information:
194
<div class="itemizedlist"><ul type="disc">
195
<li><p>visible (shown/hidden)</p></li>
196
<li><p>sensitive (enabled/disabled)</p></li>
201
Apart from regular actions, there are <a href="GtkToggleAction.html" title="GtkToggleAction">toggle
202
actions</a>, which can be toggled between two states and <a href="GtkRadioAction.html" title="GtkRadioAction">radio actions</a>, of which only one in a group
203
can be in the "active" state. Other actions can be implemented as <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a>
207
Each action can have one or more proxy menu item, toolbar button or
208
other proxy widgets. Proxies mirror the state of the action (text
209
label, tooltip, icon, visible, sensitive, etc), and should change when
210
the action's state changes. When the proxy is activated, it should
214
<div class="refsect1" lang="en">
215
<a name="id3437177"></a><h2>Details</h2>
216
<div class="refsect2" lang="en">
217
<a name="id3437187"></a><h3>
218
<a name="GtkAction-struct"></a>GtkAction</h3>
219
<a class="indexterm" name="id3437200"></a><pre class="programlisting">typedef struct _GtkAction GtkAction;</pre>
221
The <span class="structname">GtkAction</span> struct contains only private members
222
and should not be accessed directly.
226
<div class="refsect2" lang="en">
227
<a name="id3437220"></a><h3>
228
<a name="gtk-action-new"></a>gtk_action_new ()</h3>
229
<a class="indexterm" name="id3437236"></a><pre class="programlisting"><a href="GtkAction.html" title="GtkAction">GtkAction</a>* gtk_action_new (const gchar *name,
231
const gchar *tooltip,
232
const gchar *stock_id);</pre>
234
Creates a new <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a> object. To add the action to a
235
<a href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> and set the accelerator for the action,
236
call <a href="GtkActionGroup.html#gtk-action-group-add-action-with-accel"><code class="function">gtk_action_group_add_action_with_accel()</code></a>.
237
See <a href="GtkUIManager.html#XML-UI" title="UI Definitions">the section called “UI Definitions”</a> for information on allowed action
242
<div class="variablelist"><table border="0">
243
<col align="left" valign="top">
246
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
247
<td> A unique name for the action
251
<td><span class="term"><em class="parameter"><code>label</code></em> :</span></td>
252
<td> the label displayed in menu items and on buttons
256
<td><span class="term"><em class="parameter"><code>tooltip</code></em> :</span></td>
257
<td> a tooltip for the action
261
<td><span class="term"><em class="parameter"><code>stock_id</code></em> :</span></td>
262
<td> the stock icon to display in widgets representing the action
266
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
267
<td> a new <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a>
273
<p class="since">Since 2.4
277
<div class="refsect2" lang="en">
278
<a name="id3437414"></a><h3>
279
<a name="gtk-action-get-name"></a>gtk_action_get_name ()</h3>
280
<a class="indexterm" name="id3437429"></a><pre class="programlisting">const gchar* gtk_action_get_name (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
282
Returns the name of the action.</p>
286
<div class="variablelist"><table border="0">
287
<col align="left" valign="top">
290
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
291
<td> the action object
295
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
296
<td> the name of the action. The string belongs to GTK+ and should not
303
<p class="since">Since 2.4
307
<div class="refsect2" lang="en">
308
<a name="id3437499"></a><h3>
309
<a name="gtk-action-is-sensitive"></a>gtk_action_is_sensitive ()</h3>
310
<a class="indexterm" name="id3437514"></a><pre class="programlisting">gboolean gtk_action_is_sensitive (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
312
Returns whether the action is effectively sensitive.</p>
316
<div class="variablelist"><table border="0">
317
<col align="left" valign="top">
320
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
321
<td> the action object
325
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
326
<td> <code class="literal">TRUE</code> if the action and its associated action group
333
<p class="since">Since 2.4
337
<div class="refsect2" lang="en">
338
<a name="id3437593"></a><h3>
339
<a name="gtk-action-get-sensitive"></a>gtk_action_get_sensitive ()</h3>
340
<a class="indexterm" name="id3437608"></a><pre class="programlisting">gboolean gtk_action_get_sensitive (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
342
Returns whether the action itself is sensitive. Note that this doesn't
343
necessarily mean effective sensitivity. See <a href="GtkAction.html#gtk-action-is-sensitive"><code class="function">gtk_action_is_sensitive()</code></a>
348
<div class="variablelist"><table border="0">
349
<col align="left" valign="top">
352
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
353
<td> the action object
357
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
358
<td> <code class="literal">TRUE</code> if the action itself is sensitive.
364
<p class="since">Since 2.4
368
<div class="refsect2" lang="en">
369
<a name="id3437699"></a><h3>
370
<a name="gtk-action-set-sensitive"></a>gtk_action_set_sensitive ()</h3>
371
<a class="indexterm" name="id3437714"></a><pre class="programlisting">void gtk_action_set_sensitive (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
372
gboolean sensitive);</pre>
374
Sets the ::sensitive property of the action to <em class="parameter"><code>sensitive</code></em>. Note that
375
this doesn't necessarily mean effective sensitivity. See
376
<a href="GtkAction.html#gtk-action-is-sensitive"><code class="function">gtk_action_is_sensitive()</code></a>
381
<div class="variablelist"><table border="0">
382
<col align="left" valign="top">
385
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
386
<td> the action object
390
<td><span class="term"><em class="parameter"><code>sensitive</code></em> :</span></td>
391
<td> <code class="literal">TRUE</code> to make the action sensitive
396
<p class="since">Since 2.6
400
<div class="refsect2" lang="en">
401
<a name="id3437822"></a><h3>
402
<a name="gtk-action-is-visible"></a>gtk_action_is_visible ()</h3>
403
<a class="indexterm" name="id3437838"></a><pre class="programlisting">gboolean gtk_action_is_visible (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
405
Returns whether the action is effectively visible.</p>
409
<div class="variablelist"><table border="0">
410
<col align="left" valign="top">
413
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
414
<td> the action object
418
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
419
<td> <code class="literal">TRUE</code> if the action and its associated action group
426
<p class="since">Since 2.4
430
<div class="refsect2" lang="en">
431
<a name="id3437916"></a><h3>
432
<a name="gtk-action-get-visible"></a>gtk_action_get_visible ()</h3>
433
<a class="indexterm" name="id3437932"></a><pre class="programlisting">gboolean gtk_action_get_visible (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
435
Returns whether the action itself is visible. Note that this doesn't
436
necessarily mean effective visibility. See <a href="GtkAction.html#gtk-action-is-sensitive"><code class="function">gtk_action_is_sensitive()</code></a>
441
<div class="variablelist"><table border="0">
442
<col align="left" valign="top">
445
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
446
<td> the action object
450
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
451
<td> <code class="literal">TRUE</code> if the action itself is visible.
457
<p class="since">Since 2.4
461
<div class="refsect2" lang="en">
462
<a name="id3438022"></a><h3>
463
<a name="gtk-action-set-visible"></a>gtk_action_set_visible ()</h3>
464
<a class="indexterm" name="id3438038"></a><pre class="programlisting">void gtk_action_set_visible (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
465
gboolean visible);</pre>
467
Sets the ::visible property of the action to <em class="parameter"><code>visible</code></em>. Note that
468
this doesn't necessarily mean effective visibility. See
469
<a href="GtkAction.html#gtk-action-is-visible"><code class="function">gtk_action_is_visible()</code></a>
474
<div class="variablelist"><table border="0">
475
<col align="left" valign="top">
478
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
479
<td> the action object
483
<td><span class="term"><em class="parameter"><code>visible</code></em> :</span></td>
484
<td> <code class="literal">TRUE</code> to make the action visible
489
<p class="since">Since 2.6
493
<div class="refsect2" lang="en">
494
<a name="id3438146"></a><h3>
495
<a name="gtk-action-activate"></a>gtk_action_activate ()</h3>
496
<a class="indexterm" name="id3438161"></a><pre class="programlisting">void gtk_action_activate (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
498
Emits the "activate" signal on the specified action, if it isn't
499
insensitive. This gets called by the proxy widgets when they get
503
It can also be used to manually activate an action.</p>
507
<div class="variablelist"><table border="0">
508
<col align="left" valign="top">
510
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
511
<td> the action object
515
<p class="since">Since 2.4
519
<div class="refsect2" lang="en">
520
<a name="id3438224"></a><h3>
521
<a name="gtk-action-create-icon"></a>gtk_action_create_icon ()</h3>
522
<a class="indexterm" name="id3438240"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_action_create_icon (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
523
<a href="gtk-Themeable-Stock-Images.html#GtkIconSize">GtkIconSize</a> icon_size);</pre>
525
This function is intended for use by action implementations to
526
create icons displayed in the proxy widgets.</p>
530
<div class="variablelist"><table border="0">
531
<col align="left" valign="top">
534
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
535
<td> the action object
539
<td><span class="term"><em class="parameter"><code>icon_size</code></em> :</span></td>
540
<td> the size of the icon that should be created.
544
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
545
<td> a widget that displays the icon for this action.
551
<p class="since">Since 2.4
555
<div class="refsect2" lang="en">
556
<a name="id3438332"></a><h3>
557
<a name="gtk-action-create-menu-item"></a>gtk_action_create_menu_item ()</h3>
558
<a class="indexterm" name="id3438348"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_action_create_menu_item (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
560
Creates a menu item widget that proxies for the given action.</p>
564
<div class="variablelist"><table border="0">
565
<col align="left" valign="top">
568
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
569
<td> the action object
573
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
574
<td> a menu item connected to the action.
580
<p class="since">Since 2.4
584
<div class="refsect2" lang="en">
585
<a name="id3438416"></a><h3>
586
<a name="gtk-action-create-tool-item"></a>gtk_action_create_tool_item ()</h3>
587
<a class="indexterm" name="id3438432"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>* gtk_action_create_tool_item (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
589
Creates a toolbar item widget that proxies for the given action.</p>
593
<div class="variablelist"><table border="0">
594
<col align="left" valign="top">
597
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
598
<td> the action object
602
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
603
<td> a toolbar item connected to the action.
609
<p class="since">Since 2.4
613
<div class="refsect2" lang="en">
614
<a name="id3438500"></a><h3>
615
<a name="gtk-action-connect-proxy"></a>gtk_action_connect_proxy ()</h3>
616
<a class="indexterm" name="id3438516"></a><pre class="programlisting">void gtk_action_connect_proxy (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
617
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);</pre>
619
Connects a widget to an action object as a proxy. Synchronises
620
various properties of the action with the widget (such as label
621
text, icon, tooltip, etc), and attaches a callback so that the
622
action gets activated when the proxy widget does.
625
If the widget is already connected to an action, it is disconnected
630
<div class="variablelist"><table border="0">
631
<col align="left" valign="top">
634
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
635
<td> the action object
639
<td><span class="term"><em class="parameter"><code>proxy</code></em> :</span></td>
640
<td> the proxy widget
645
<p class="since">Since 2.4
649
<div class="refsect2" lang="en">
650
<a name="id3438603"></a><h3>
651
<a name="gtk-action-disconnect-proxy"></a>gtk_action_disconnect_proxy ()</h3>
652
<a class="indexterm" name="id3438619"></a><pre class="programlisting">void gtk_action_disconnect_proxy (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
653
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);</pre>
655
Disconnects a proxy widget from an action.
656
Does <span class="emphasis"><em>not</em></span> destroy the widget, however.</p>
660
<div class="variablelist"><table border="0">
661
<col align="left" valign="top">
664
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
665
<td> the action object
669
<td><span class="term"><em class="parameter"><code>proxy</code></em> :</span></td>
670
<td> the proxy widget
675
<p class="since">Since 2.4
679
<div class="refsect2" lang="en">
680
<a name="id3438702"></a><h3>
681
<a name="gtk-action-get-proxies"></a>gtk_action_get_proxies ()</h3>
682
<a class="indexterm" name="id3438717"></a><pre class="programlisting">GSList* gtk_action_get_proxies (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
684
Returns the proxy widgets for an action.
685
See also <a href="GtkWidget.html#gtk-widget-get-action"><code class="function">gtk_widget_get_action()</code></a>.</p>
689
<div class="variablelist"><table border="0">
690
<col align="left" valign="top">
693
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
694
<td> the action object
698
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
699
<td> a <span class="type">GSList</span> of proxy widgets. The list is owned by GTK+
700
and must not be modified.
706
<p class="since">Since 2.4
710
<div class="refsect2" lang="en">
711
<a name="id3438806"></a><h3>
712
<a name="gtk-action-connect-accelerator"></a>gtk_action_connect_accelerator ()</h3>
713
<a class="indexterm" name="id3438822"></a><pre class="programlisting">void gtk_action_connect_accelerator (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
715
Installs the accelerator for <em class="parameter"><code>action</code></em> if <em class="parameter"><code>action</code></em> has an
716
accel path and group. See <a href="GtkAction.html#gtk-action-set-accel-path"><code class="function">gtk_action_set_accel_path()</code></a> and
717
<a href="GtkAction.html#gtk-action-set-accel-group"><code class="function">gtk_action_set_accel_group()</code></a>
720
Since multiple proxies may independently trigger the installation
721
of the accelerator, the <em class="parameter"><code>action</code></em> counts the number of times this
722
function has been called and doesn't remove the accelerator until
723
<a href="GtkAction.html#gtk-action-disconnect-accelerator"><code class="function">gtk_action_disconnect_accelerator()</code></a> has been called as many times.</p>
727
<div class="variablelist"><table border="0">
728
<col align="left" valign="top">
730
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
731
<td> a <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a>
735
<p class="since">Since 2.4
739
<div class="refsect2" lang="en">
740
<a name="id3438946"></a><h3>
741
<a name="gtk-action-disconnect-accelerator"></a>gtk_action_disconnect_accelerator ()</h3>
742
<a class="indexterm" name="id3438961"></a><pre class="programlisting">void gtk_action_disconnect_accelerator (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
744
Undoes the effect of one call to <a href="GtkAction.html#gtk-action-connect-accelerator"><code class="function">gtk_action_connect_accelerator()</code></a>.</p>
748
<div class="variablelist"><table border="0">
749
<col align="left" valign="top">
751
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
752
<td> a <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a>
756
<p class="since">Since 2.4
760
<div class="refsect2" lang="en">
761
<a name="id3439037"></a><h3>
762
<a name="gtk-action-block-activate-from"></a>gtk_action_block_activate_from ()</h3>
763
<a class="indexterm" name="id3439053"></a><pre class="programlisting">void gtk_action_block_activate_from (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
764
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);</pre>
766
Disables calls to the <a href="GtkAction.html#gtk-action-activate"><code class="function">gtk_action_activate()</code></a>
767
function by signals on the given proxy widget. This is used to
768
break notification loops for things like check or radio actions.
771
This function is intended for use by action implementations.</p>
775
<div class="variablelist"><table border="0">
776
<col align="left" valign="top">
779
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
780
<td> the action object
784
<td><span class="term"><em class="parameter"><code>proxy</code></em> :</span></td>
790
<p class="since">Since 2.4
794
<div class="refsect2" lang="en">
795
<a name="id3439149"></a><h3>
796
<a name="gtk-action-unblock-activate-from"></a>gtk_action_unblock_activate_from ()</h3>
797
<a class="indexterm" name="id3439165"></a><pre class="programlisting">void gtk_action_unblock_activate_from (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
798
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *proxy);</pre>
800
Re-enables calls to the <a href="GtkAction.html#gtk-action-activate"><code class="function">gtk_action_activate()</code></a>
801
function by signals on the given proxy widget. This undoes the
802
blocking done by <a href="GtkAction.html#gtk-action-block-activate-from"><code class="function">gtk_action_block_activate_from()</code></a>.
805
This function is intended for use by action implementations.</p>
809
<div class="variablelist"><table border="0">
810
<col align="left" valign="top">
813
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
814
<td> the action object
818
<td><span class="term"><em class="parameter"><code>proxy</code></em> :</span></td>
824
<p class="since">Since 2.4
828
<div class="refsect2" lang="en">
829
<a name="id3439271"></a><h3>
830
<a name="gtk-action-get-accel-path"></a>gtk_action_get_accel_path ()</h3>
831
<a class="indexterm" name="id3439288"></a><pre class="programlisting">const gchar* gtk_action_get_accel_path (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
833
Returns the accel path for this action.</p>
837
<div class="variablelist"><table border="0">
838
<col align="left" valign="top">
841
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
842
<td> the action object
846
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
847
<td> the accel path for this action, or <a
848
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
849
><code class="literal">NULL</code></a>
850
if none is set. The returned string is owned by GTK+
851
and must not be freed or modified.
856
<p class="since">Since 2.6
861
<div class="refsect2" lang="en">
862
<a name="id3439368"></a><h3>
863
<a name="gtk-action-set-accel-path"></a>gtk_action_set_accel_path ()</h3>
864
<a class="indexterm" name="id3439385"></a><pre class="programlisting">void gtk_action_set_accel_path (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
865
const gchar *accel_path);</pre>
867
Sets the accel path for this action. All proxy widgets associated
868
with the action will have this accel path, so that their
869
accelerators are consistent.</p>
873
<div class="variablelist"><table border="0">
874
<col align="left" valign="top">
877
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
878
<td> the action object
882
<td><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></td>
883
<td> the accelerator path
888
<p class="since">Since 2.4
892
<div class="refsect2" lang="en">
893
<a name="id3439465"></a><h3>
894
<a name="gtk-action-get-accel-closure"></a>gtk_action_get_accel_closure ()</h3>
895
<a class="indexterm" name="id3439481"></a><pre class="programlisting">GClosure* gtk_action_get_accel_closure (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action);</pre>
897
Returns the accel closure for this action.</p>
901
<div class="variablelist"><table border="0">
902
<col align="left" valign="top">
905
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
906
<td> the action object
910
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
911
<td> the accel closure for this action. The returned closure is
912
owned by GTK+ and must not be unreffed or modified.
917
<p class="since">Since 2.8
922
<div class="refsect2" lang="en">
923
<a name="id3439551"></a><h3>
924
<a name="gtk-action-set-accel-group"></a>gtk_action_set_accel_group ()</h3>
925
<a class="indexterm" name="id3439567"></a><pre class="programlisting">void gtk_action_set_accel_group (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
926
<a href="gtk-Keyboard-Accelerators.html#GtkAccelGroup">GtkAccelGroup</a> *accel_group);</pre>
928
Sets the <a href="gtk-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> in which the accelerator for this action
929
will be installed.</p>
933
<div class="variablelist"><table border="0">
934
<col align="left" valign="top">
937
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
938
<td> the action object
942
<td><span class="term"><em class="parameter"><code>accel_group</code></em> :</span></td>
943
<td> a <a href="gtk-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> or <a
944
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
945
><code class="literal">NULL</code></a>
950
<p class="since">Since 2.4
954
<div class="refsect1" lang="en">
955
<a name="id3439674"></a><h2>Property Details</h2>
956
<div class="refsect2" lang="en">
957
<a name="id3439684"></a><h3>
958
<a name="GtkAction--action-group"></a>The "<code class="literal">action-group</code>" property</h3>
959
<a class="indexterm" name="id3439701"></a><pre class="programlisting"> "action-group" <a href="GtkActionGroup.html" title="GtkActionGroup">GtkActionGroup</a> : Read / Write</pre>
960
<p>The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).</p>
963
<div class="refsect2" lang="en">
964
<a name="id3439725"></a><h3>
965
<a name="GtkAction--hide-if-empty"></a>The "<code class="literal">hide-if-empty</code>" property</h3>
966
<a class="indexterm" name="id3439742"></a><pre class="programlisting"> "hide-if-empty" gboolean : Read / Write</pre>
967
<p>When TRUE, empty menu proxies for this action are hidden.</p>
968
<p>Default value: TRUE</p>
971
<div class="refsect2" lang="en">
972
<a name="id3439769"></a><h3>
973
<a name="GtkAction--icon-name"></a>The "<code class="literal">icon-name</code>" property</h3>
974
<a class="indexterm" name="id3439786"></a><pre class="programlisting"> "icon-name" gchararray : Read / Write</pre>
976
The name of the icon from the icon theme.
977
Note that the stock icon is preferred, if
978
the ::stock-id property holds the id of an
979
existing stock icon.</p>
983
<p>Default value: NULL</p>
988
<div class="refsect2" lang="en">
989
<a name="id3439823"></a><h3>
990
<a name="GtkAction--is-important"></a>The "<code class="literal">is-important</code>" property</h3>
991
<a class="indexterm" name="id3439839"></a><pre class="programlisting"> "is-important" gboolean : Read / Write</pre>
992
<p>Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode.</p>
993
<p>Default value: FALSE</p>
996
<div class="refsect2" lang="en">
997
<a name="id3439867"></a><h3>
998
<a name="GtkAction--label"></a>The "<code class="literal">label</code>" property</h3>
999
<a class="indexterm" name="id3439883"></a><pre class="programlisting"> "label" gchararray : Read / Write</pre>
1000
<p>The label used for menu items and buttons that activate this action.</p>
1001
<p>Default value: NULL</p>
1004
<div class="refsect2" lang="en">
1005
<a name="id3439911"></a><h3>
1006
<a name="GtkAction--name"></a>The "<code class="literal">name</code>" property</h3>
1007
<a class="indexterm" name="id3439927"></a><pre class="programlisting"> "name" gchararray : Read / Write / Construct Only</pre>
1008
<p>A unique name for the action.</p>
1009
<p>Default value: NULL</p>
1012
<div class="refsect2" lang="en">
1013
<a name="id3439955"></a><h3>
1014
<a name="GtkAction--sensitive"></a>The "<code class="literal">sensitive</code>" property</h3>
1015
<a class="indexterm" name="id3439971"></a><pre class="programlisting"> "sensitive" gboolean : Read / Write</pre>
1016
<p>Whether the action is enabled.</p>
1017
<p>Default value: TRUE</p>
1020
<div class="refsect2" lang="en">
1021
<a name="id3439998"></a><h3>
1022
<a name="GtkAction--short-label"></a>The "<code class="literal">short-label</code>" property</h3>
1023
<a class="indexterm" name="id3440014"></a><pre class="programlisting"> "short-label" gchararray : Read / Write</pre>
1024
<p>A shorter label that may be used on toolbar buttons.</p>
1025
<p>Default value: NULL</p>
1028
<div class="refsect2" lang="en">
1029
<a name="id3440040"></a><h3>
1030
<a name="GtkAction--stock-id"></a>The "<code class="literal">stock-id</code>" property</h3>
1031
<a class="indexterm" name="id3440056"></a><pre class="programlisting"> "stock-id" gchararray : Read / Write</pre>
1032
<p>The stock icon displayed in widgets representing this action.</p>
1033
<p>Default value: NULL</p>
1036
<div class="refsect2" lang="en">
1037
<a name="id3440083"></a><h3>
1038
<a name="GtkAction--tooltip"></a>The "<code class="literal">tooltip</code>" property</h3>
1039
<a class="indexterm" name="id3440099"></a><pre class="programlisting"> "tooltip" gchararray : Read / Write</pre>
1040
<p>A tooltip for this action.</p>
1041
<p>Default value: NULL</p>
1044
<div class="refsect2" lang="en">
1045
<a name="id3440125"></a><h3>
1046
<a name="GtkAction--visible"></a>The "<code class="literal">visible</code>" property</h3>
1047
<a class="indexterm" name="id3440142"></a><pre class="programlisting"> "visible" gboolean : Read / Write</pre>
1048
<p>Whether the action is visible.</p>
1049
<p>Default value: TRUE</p>
1052
<div class="refsect2" lang="en">
1053
<a name="id3440168"></a><h3>
1054
<a name="GtkAction--visible-horizontal"></a>The "<code class="literal">visible-horizontal</code>" property</h3>
1055
<a class="indexterm" name="id3440185"></a><pre class="programlisting"> "visible-horizontal" gboolean : Read / Write</pre>
1056
<p>Whether the toolbar item is visible when the toolbar is in a horizontal orientation.</p>
1057
<p>Default value: TRUE</p>
1060
<div class="refsect2" lang="en">
1061
<a name="id3440213"></a><h3>
1062
<a name="GtkAction--visible-overflown"></a>The "<code class="literal">visible-overflown</code>" property</h3>
1063
<a class="indexterm" name="id3440230"></a><pre class="programlisting"> "visible-overflown" gboolean : Read / Write</pre>
1065
When <code class="literal">TRUE</code>, toolitem proxies for this action are represented in the
1066
toolbar overflow menu.</p>
1070
<p>Default value: TRUE</p>
1075
<div class="refsect2" lang="en">
1076
<a name="id3440276"></a><h3>
1077
<a name="GtkAction--visible-vertical"></a>The "<code class="literal">visible-vertical</code>" property</h3>
1078
<a class="indexterm" name="id3440293"></a><pre class="programlisting"> "visible-vertical" gboolean : Read / Write</pre>
1079
<p>Whether the toolbar item is visible when the toolbar is in a vertical orientation.</p>
1080
<p>Default value: TRUE</p>
1083
<div class="refsect1" lang="en">
1084
<a name="id3440322"></a><h2>Signal Details</h2>
1085
<div class="refsect2" lang="en">
1086
<a name="id3440332"></a><h3>
1087
<a name="GtkAction-activate"></a>The "activate" signal</h3>
1088
<a class="indexterm" name="id3440342"></a><pre class="programlisting">void user_function (<a href="GtkAction.html" title="GtkAction">GtkAction</a> *action,
1089
gpointer user_data) : Run First / No Recursion</pre>
1091
The "activate" signal is emitted when the action is activated.</p>
1095
<div class="variablelist"><table border="0">
1096
<col align="left" valign="top">
1099
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
1100
<td> the <a href="GtkAction.html" title="GtkAction"><span class="type">GtkAction</span></a>
1104
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
1105
<td>user data set when the signal handler was connected.</td>
1113
<div class="refsect1" lang="en">
1114
<a name="id3440429"></a><h2>See Also</h2>
1116
<a href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a>, <a href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a>