]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkcheckmenuitem.sgml
ran make templates, to fix problems with structs.
[~andy/gtk] / docs / reference / gtk / tmpl / gtkcheckmenuitem.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkCheckMenuItem
3
4 <!-- ##### SECTION Short_Description ##### -->
5 a menu item with a check box.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 A #GtkCheckMenuItem is a menu item that maintains the state of a boolean 
10 value in addition to a #GtkMenuItem's usual role in activating application
11 code.
12 </para>
13
14 <para>
15 A check box indicating the state of the boolean value is displayed
16 at the left side of the #GtkMenuItem.  Activating the #GtkMenuItem 
17 toggles the value.
18 </para>
19
20 <!-- ##### SECTION See_Also ##### -->
21 <para>
22
23 </para>
24
25 <!-- ##### STRUCT GtkCheckMenuItem ##### -->
26 <para>
27 The #GtkCheckMenuItem-struct struct contains the following fields.
28 (These fields should be considered read-only. They should never be set by
29 an application.)
30
31 <informaltable pgwide=1 frame="none" role="struct">
32 <tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*">
33 <tbody>
34
35 <row>
36 <entry>#guint active;</entry>
37 <entry>TRUE if the check box is active.</entry>
38 </row>
39
40 </tbody></tgroup></informaltable>
41 </para>
42
43
44 <!-- ##### FUNCTION gtk_check_menu_item_new ##### -->
45 <para>
46 Creates a new #GtkCheckMenuItem.
47 </para>
48
49 @Returns: a new #GtkCheckMenuItem.
50
51
52 <!-- ##### FUNCTION gtk_check_menu_item_new_with_label ##### -->
53 <para>
54 Creates a new #GtkCheckMenuItem with a label.
55 </para>
56
57 @label: the string to use for the label.
58 @Returns: a new #GtkCheckMenuItem.
59
60
61 <!-- ##### MACRO gtk_check_menu_item_set_state ##### -->
62 <para>
63 This macro is provided to preserve compatibility with older code.
64 New code should use gtk_check_menu_item_set_active() function instead.
65 </para>
66
67
68
69 <!-- ##### FUNCTION gtk_check_menu_item_set_active ##### -->
70 <para>
71 Sets the active state of the menu item's check box.
72 </para>
73
74 @check_menu_item: a #GtkCheckMenuItem.
75 @is_active: boolean value indicating whether the check box is active.
76
77
78 <!-- ##### FUNCTION gtk_check_menu_item_set_show_toggle ##### -->
79 <para>
80 Controls whether the check box is shown at all times.
81 Normally the check box is shown only when it is active or while the 
82 menu item is selected.
83 </para>
84
85 @menu_item: a #GtkCheckMenuItem.
86 @always: boolean value indicating whether to always show the check box.
87
88
89 <!-- ##### FUNCTION gtk_check_menu_item_toggled ##### -->
90 <para>
91 Emits the GtkCheckMenuItem::toggled signal.
92 </para>
93
94 @check_menu_item: a #GtkCheckMenuItem.
95
96
97 <!-- ##### SIGNAL GtkCheckMenuItem::toggled ##### -->
98 <para>
99 This signal is emitted when the state of the check box is changed.
100 </para>
101
102 <para>
103 A signal handler can examine the <structfield>active</structfield> 
104 field of the #GtkCheckMenuItem-struct struct to discover the new state.
105 </para>
106
107 @checkmenuitem: the object which received the signal.
108