summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkaction.sgml
blob: 53e99f9152350fe5f4f70276f3a2b0c99023c0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<!-- ##### SECTION Title ##### -->
GtkAction

<!-- ##### SECTION Short_Description ##### -->
An action which can be triggered by a menu or toolbar item

<!-- ##### SECTION Long_Description ##### -->
<para>
Actions represent operations that the user can be perform, along with
some information how it should be presented in the interface. Each action 
provides methods to create icons, menu items and toolbar items representing 
itself.
</para>
<para>
As well as the callback that is called when the action gets activated, the 
following also gets associated with the action:
<itemizedlist>
  <listitem><para>a name (not translated, for path lookup)</para></listitem>
  <listitem><para>a label (translated, for display)</para></listitem>
  <listitem><para>an accelerator</para></listitem>
  <listitem><para>whether label indicates a stock id</para></listitem>
  <listitem><para>a tooltip (optional, translated)</para></listitem>
  <listitem><para>a toolbar label (optional, shorter than label)</para></listitem>
</itemizedlist>
The action will also have some state information:
<itemizedlist>
  <listitem><para>visible (shown/hidden)</para></listitem>
  <listitem><para>sensitive (enabled/disabled)</para></listitem>
</itemizedlist>
</para>
<para>
Apart from regular actions, there are <link linkend="GtkToggleAction">toggle 
actions</link>, which can be toggled between two states and <link 
linkend="GtkRadioAction">radio actions</link>, of which only one in a group 
can be in the "active" state. Other actions can be implemented as #GtkAction 
subclasses.
</para>
<para>
Each action can have one or more proxy menu item, toolbar button or
other proxy widgets.  Proxies mirror the state of the action (text
label, tooltip, icon, visible, sensitive, etc), and should change when
the action's state changes. When the proxy is activated, it should
activate its action.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#GtkActionGroup, #GtkUIManager
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### SECTION Image ##### -->


<!-- ##### STRUCT GtkAction ##### -->
<para>
The <structname>GtkAction</structname> struct contains only private members
and should not be accessed directly.
</para>


<!-- ##### SIGNAL GtkAction::activate ##### -->
<para>

</para>

@action: the object which received the signal.

<!-- ##### ARG GtkAction:action-group ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:always-show-image ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:gicon ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:hide-if-empty ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:icon-name ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:is-important ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:label ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:name ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:sensitive ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:short-label ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:stock-id ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:tooltip ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:visible ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:visible-horizontal ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:visible-overflown ##### -->
<para>

</para>

<!-- ##### ARG GtkAction:visible-vertical ##### -->
<para>

</para>

<!-- ##### FUNCTION gtk_action_new ##### -->
<para>

</para>

@name: 
@label: 
@tooltip: 
@stock_id: 
@Returns: 


<!-- ##### FUNCTION gtk_action_get_name ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_is_sensitive ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_get_sensitive ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_sensitive ##### -->
<para>

</para>

@action: 
@sensitive: 


<!-- ##### FUNCTION gtk_action_is_visible ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_get_visible ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_visible ##### -->
<para>

</para>

@action: 
@visible: 


<!-- ##### FUNCTION gtk_action_activate ##### -->
<para>

</para>

@action: 


<!-- ##### FUNCTION gtk_action_create_icon ##### -->
<para>

</para>

@action: 
@icon_size: 
@Returns: 


<!-- ##### FUNCTION gtk_action_create_menu_item ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_create_tool_item ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_create_menu ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_connect_proxy ##### -->
<para>

</para>

@action: 
@proxy: 


<!-- ##### FUNCTION gtk_action_disconnect_proxy ##### -->
<para>

</para>

@action: 
@proxy: 


<!-- ##### FUNCTION gtk_action_get_proxies ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_connect_accelerator ##### -->
<para>

</para>

@action: 


<!-- ##### FUNCTION gtk_action_disconnect_accelerator ##### -->
<para>

</para>

@action: 


<!-- ##### FUNCTION gtk_action_block_activate ##### -->
<para>

</para>

@action: 


<!-- ##### FUNCTION gtk_action_unblock_activate ##### -->
<para>

</para>

@action: 


<!-- ##### FUNCTION gtk_action_block_activate_from ##### -->
<para>

</para>

@action: 
@proxy: 


<!-- ##### FUNCTION gtk_action_unblock_activate_from ##### -->
<para>

</para>

@action: 
@proxy: 


<!-- ##### FUNCTION gtk_action_get_always_show_image ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_always_show_image ##### -->
<para>

</para>

@action: 
@always_show: 


<!-- ##### FUNCTION gtk_action_get_accel_path ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_accel_path ##### -->
<para>

</para>

@action: 
@accel_path: 


<!-- ##### FUNCTION gtk_action_get_accel_closure ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_accel_group ##### -->
<para>

</para>

@action: 
@accel_group: 


<!-- ##### FUNCTION gtk_action_set_label ##### -->
<para>

</para>

@action: 
@label: 


<!-- ##### FUNCTION gtk_action_get_label ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_short_label ##### -->
<para>

</para>

@action: 
@short_label: 


<!-- ##### FUNCTION gtk_action_get_short_label ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_tooltip ##### -->
<para>

</para>

@action: 
@tooltip: 


<!-- ##### FUNCTION gtk_action_get_tooltip ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_stock_id ##### -->
<para>

</para>

@action: 
@stock_id: 


<!-- ##### FUNCTION gtk_action_get_stock_id ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_gicon ##### -->
<para>

</para>

@action: 
@icon: 


<!-- ##### FUNCTION gtk_action_get_gicon ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_icon_name ##### -->
<para>

</para>

@action: 
@icon_name: 


<!-- ##### FUNCTION gtk_action_get_icon_name ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_visible_horizontal ##### -->
<para>

</para>

@action: 
@visible_horizontal: 


<!-- ##### FUNCTION gtk_action_get_visible_horizontal ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_visible_vertical ##### -->
<para>

</para>

@action: 
@visible_vertical: 


<!-- ##### FUNCTION gtk_action_get_visible_vertical ##### -->
<para>

</para>

@action: 
@Returns: 


<!-- ##### FUNCTION gtk_action_set_is_important ##### -->
<para>

</para>

@action: 
@is_important: 


<!-- ##### FUNCTION gtk_action_get_is_important ##### -->
<para>

</para>

@action: 
@Returns: