]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkactiongroup.sgml
Make 3.0 parallel-installable to 2.x
[~andy/gtk] / docs / reference / gtk / tmpl / gtkactiongroup.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkActionGroup
3
4 <!-- ##### SECTION Short_Description ##### -->
5 A group of actions
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 Actions are organised into groups.  An action group is essentially a
10 map from names to #GtkAction objects.
11 </para>
12 <para>
13 All actions that would make sense to use in a particular context
14 should be in a single group.  Multiple action groups may be used for a
15 particular user interface.  In fact, it is expected that most nontrivial 
16 applications will make use of multiple groups.  For example, in an application
17 that can edit multiple documents, one group holding global actions 
18 (e.g. quit, about, new), and one group per document holding actions that 
19 act on that document (eg. save, cut/copy/paste, etc).  Each window's menus 
20 would be constructed from a combination of two action groups.
21 </para>
22 <para id="Action-Accel">
23 Accelerators are handled by the GTK+ accelerator map. All actions are assigned an 
24 accelerator path (which normally has the form 
25 <literal>&lt;Actions&gt;/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>) 
26 and a shortcut is associated with this accelerator path. All menuitems and 
27 toolitems take on this accelerator path. The GTK+ accelerator map code makes 
28 sure that the correct shortcut is displayed next to the menu item.
29 </para>
30
31 <refsect2 id="GtkActionGroup-BUILDER-UI">
32 <title>GtkActionGroup as GtkBuildable</title>
33 <para>
34 The GtkActionGroup implementation of the GtkBuildable interface accepts
35 GtkAction objects as &lt;child&gt; elements in UI definitions.
36 </para>
37 <para>
38 Note that it is probably more common to define actions and action groups
39 in the code, since they are directly related to what the code can do.
40 </para>
41 <para>
42 The GtkActionGroup implementation of the GtkBuildable interface supports a 
43 custom &lt;accelerator&gt; element, which has attributes named key and
44 modifiers and allows to specify accelerators. This is similar to the 
45 &lt;accelerator&gt; element of GtkWidget, the main difference is that 
46 it doesn't allow you to specify a signal.
47 </para>
48 <example>
49 <title>A <structname>GtkDialog</structname> UI definition fragment.</title>
50 <programlisting><![CDATA[
51 <object class="GtkActionGroup" id="actiongroup">
52   <child>
53       <object class="GtkAction" id="About">
54           <property name="name">About</property>
55           <property name="stock_id">gtk-about</property>
56           <signal handler="about_activate" name="activate"/>
57       </object>
58       <accelerator key="F1" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK"/>
59   </child>
60 </object>
61 ]]></programlisting>
62 </example>
63 </refsect2>
64
65 <!-- ##### SECTION See_Also ##### -->
66 <para>
67
68 </para>
69
70 <!-- ##### SECTION Stability_Level ##### -->
71
72
73 <!-- ##### SECTION Image ##### -->
74
75
76 <!-- ##### STRUCT GtkActionGroup ##### -->
77 <para>
78 The <structname>GtkActionGroup</structname> struct contains only private 
79 members and should not be accessed directly.
80 </para>
81
82
83 <!-- ##### SIGNAL GtkActionGroup::connect-proxy ##### -->
84 <para>
85
86 </para>
87
88 @actiongroup: the object which received the signal.
89 @arg1: 
90 @widget: 
91
92 <!-- ##### SIGNAL GtkActionGroup::disconnect-proxy ##### -->
93 <para>
94
95 </para>
96
97 @actiongroup: the object which received the signal.
98 @arg1: 
99 @widget: 
100
101 <!-- ##### SIGNAL GtkActionGroup::post-activate ##### -->
102 <para>
103
104 </para>
105
106 @actiongroup: the object which received the signal.
107 @arg1: 
108
109 <!-- ##### SIGNAL GtkActionGroup::pre-activate ##### -->
110 <para>
111
112 </para>
113
114 @actiongroup: the object which received the signal.
115 @arg1: 
116
117 <!-- ##### ARG GtkActionGroup:name ##### -->
118 <para>
119
120 </para>
121
122 <!-- ##### ARG GtkActionGroup:sensitive ##### -->
123 <para>
124
125 </para>
126
127 <!-- ##### ARG GtkActionGroup:visible ##### -->
128 <para>
129
130 </para>
131
132 <!-- ##### FUNCTION gtk_action_group_new ##### -->
133 <para>
134
135 </para>
136
137 @name: 
138 @Returns: 
139
140
141 <!-- ##### FUNCTION gtk_action_group_get_name ##### -->
142 <para>
143
144 </para>
145
146 @action_group: 
147 @Returns: 
148
149
150 <!-- ##### FUNCTION gtk_action_group_get_sensitive ##### -->
151 <para>
152
153 </para>
154
155 @action_group: 
156 @Returns: 
157
158
159 <!-- ##### FUNCTION gtk_action_group_set_sensitive ##### -->
160 <para>
161
162 </para>
163
164 @action_group: 
165 @sensitive: 
166
167
168 <!-- ##### FUNCTION gtk_action_group_get_visible ##### -->
169 <para>
170
171 </para>
172
173 @action_group: 
174 @Returns: 
175
176
177 <!-- ##### FUNCTION gtk_action_group_set_visible ##### -->
178 <para>
179
180 </para>
181
182 @action_group: 
183 @visible: 
184
185
186 <!-- ##### FUNCTION gtk_action_group_get_action ##### -->
187 <para>
188
189 </para>
190
191 @action_group: 
192 @action_name: 
193 @Returns: 
194
195
196 <!-- ##### FUNCTION gtk_action_group_list_actions ##### -->
197 <para>
198
199 </para>
200
201 @action_group: 
202 @Returns: 
203
204
205 <!-- ##### FUNCTION gtk_action_group_add_action ##### -->
206 <para>
207
208 </para>
209
210 @action_group: 
211 @action: 
212
213
214 <!-- ##### FUNCTION gtk_action_group_add_action_with_accel ##### -->
215 <para>
216
217 </para>
218
219 @action_group: 
220 @action: 
221 @accelerator: 
222
223
224 <!-- ##### FUNCTION gtk_action_group_remove_action ##### -->
225 <para>
226
227 </para>
228
229 @action_group: 
230 @action: 
231
232
233 <!-- ##### STRUCT GtkActionEntry ##### -->
234 <para>
235 <structname>GtkActionEntry</structname> structs are used with 
236 gtk_action_group_add_actions() to construct actions.
237 </para>
238
239 @name: The name of the action.
240 @stock_id: The stock id for the action, or the name of an icon from the icon 
241     theme.
242 @label: The label for the action. This field should typically be marked for 
243     translation, see gtk_action_group_set_translation_domain(). If @label
244     is %NULL, the label of the stock item with id @stock_id is used.
245 @accelerator: The accelerator for the action, in the format understood by 
246     gtk_accelerator_parse().
247 @tooltip: The tooltip for the action. This field should typically be marked 
248     for translation, see gtk_action_group_set_translation_domain().
249 @callback: The function to call when the action is activated.
250
251 <!-- ##### FUNCTION gtk_action_group_add_actions ##### -->
252 <para>
253
254 </para>
255
256 @action_group: 
257 @entries: 
258 @n_entries: 
259 @user_data: 
260
261
262 <!-- ##### FUNCTION gtk_action_group_add_actions_full ##### -->
263 <para>
264
265 </para>
266
267 @action_group: 
268 @entries: 
269 @n_entries: 
270 @user_data: 
271 @destroy: 
272
273
274 <!-- ##### STRUCT GtkToggleActionEntry ##### -->
275 <para>
276 <structname>GtkToggleActionEntry</structname> structs are used with 
277 gtk_action_group_add_toggle_actions() to construct toggle actions.
278 </para>
279
280 @name: The name of the action.
281 @stock_id: The stock id for the action, or the name of an icon from the icon 
282     theme.
283 @label: The label for the action. This field should typically be marked for 
284     translation, see gtk_action_group_set_translation_domain().
285 @accelerator: The accelerator for the action, in the format understood by 
286     gtk_accelerator_parse().
287 @tooltip: The tooltip for the action. This field should typically be marked 
288     for translation, see gtk_action_group_set_translation_domain().
289 @callback: The function to call when the action is activated.
290 @is_active: The initial state of the toggle action.
291
292 <!-- ##### FUNCTION gtk_action_group_add_toggle_actions ##### -->
293 <para>
294
295 </para>
296
297 @action_group: 
298 @entries: 
299 @n_entries: 
300 @user_data: 
301
302
303 <!-- ##### FUNCTION gtk_action_group_add_toggle_actions_full ##### -->
304 <para>
305
306 </para>
307
308 @action_group: 
309 @entries: 
310 @n_entries: 
311 @user_data: 
312 @destroy: 
313
314
315 <!-- ##### STRUCT GtkRadioActionEntry ##### -->
316 <para>
317 <structname>GtkRadioActionEntry</structname> structs are used with 
318 gtk_action_group_add_radio_actions() to construct groups of radio actions.
319 </para>
320
321 @name: The name of the action.
322 @stock_id: The stock id for the action, or the name of an icon from the icon 
323     theme.
324 @label: The label for the action. This field should typically be marked for 
325     translation, see gtk_action_group_set_translation_domain().
326 @accelerator: The accelerator for the action, in the format understood by 
327     gtk_accelerator_parse().
328 @tooltip: The tooltip for the action. This field should typically be marked for 
329     translation, see gtk_action_group_set_translation_domain().
330 @value: The value to set on the radio action. See gtk_radio_action_get_current_value().
331
332 <!-- ##### FUNCTION gtk_action_group_add_radio_actions ##### -->
333 <para>
334
335 </para>
336
337 @action_group: 
338 @entries: 
339 @n_entries: 
340 @value: 
341 @on_change: 
342 @user_data: 
343
344
345 <!-- ##### FUNCTION gtk_action_group_add_radio_actions_full ##### -->
346 <para>
347
348 </para>
349
350 @action_group: 
351 @entries: 
352 @n_entries: 
353 @value: 
354 @on_change: 
355 @user_data: 
356 @destroy: 
357
358
359 <!-- ##### FUNCTION gtk_action_group_set_translate_func ##### -->
360 <para>
361
362 </para>
363
364 @action_group: 
365 @func: 
366 @data: 
367 @notify: 
368
369
370 <!-- ##### FUNCTION gtk_action_group_set_translation_domain ##### -->
371 <para>
372
373 </para>
374
375 @action_group: 
376 @domain: 
377
378
379 <!-- ##### FUNCTION gtk_action_group_translate_string ##### -->
380 <para>
381
382 </para>
383
384 @action_group: 
385 @string: 
386 @Returns: 
387
388