summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkradiomenuitem.sgml
blob: b404e8c4885590a533a85267722c90beeb1de352 (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
<!-- ##### SECTION Title ##### -->
GtkRadioMenuItem

<!-- ##### SECTION Short_Description ##### -->
A choice from multiple check menu items

<!-- ##### SECTION Long_Description ##### -->
<para>
A radio menu item is a check menu item that belongs to a group. At each
instant exactly one of the radio menu items from a group is selected.
</para>
<para>
The group list does not need to be freed, as each #GtkRadioMenuItem will 
remove itself and its list item when it is destroyed.
</para>
<para>
The correct way to create a group of radio menu items is approximatively
this:
</para>
<example>
<title>How to create a group of radio menu items.</title>
<programlisting>
GSList *group = NULL;
GtkWidget *item;
gint i;

for (i = 0; i &lt; 5; i++)
{
  item = gtk_radio_menu_item_new_with_label (group, "This is an example");
  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
  if (i == 1)
    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
}
</programlisting>
</example>

<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>
<varlistentry>
<term>#GtkMenuItem</term>
<listitem><para>because a radio menu item is a menu item.</para></listitem>
</varlistentry>
<varlistentry>
<term>#GtkCheckMenuItem</term>
<listitem><para>to know how to handle the check.</para></listitem>
</varlistentry>
</variablelist>
</para>

<!-- ##### STRUCT GtkRadioMenuItem ##### -->
<para>
The structure contains only private data that must be accessed through
the interface functions.
</para>


<!-- ##### SIGNAL GtkRadioMenuItem::group-changed ##### -->
<para>

</para>

@radiomenuitem: the object which received the signal.

<!-- ##### FUNCTION gtk_radio_menu_item_new ##### -->
<para>
Creates a new #GtkRadioMenuItem.
</para>

@group: the group to which the radio menu item is to be attached
@Returns: a new #GtkRadioMenuItem


<!-- ##### FUNCTION gtk_radio_menu_item_new_with_label ##### -->
<para>
Creates a new #GtkRadioMenuItem whose child is a simple #GtkLabel.
</para>

@group: the group to which the radio menu item is to be attached
@label: the text for the label
@Returns: a new #GtkRadioMenuItem


<!-- ##### FUNCTION gtk_radio_menu_item_new_with_mnemonic ##### -->
<para>

</para>

@group: 
@label: 
@Returns: 


<!-- ##### FUNCTION gtk_radio_menu_item_new_from_widget ##### -->
<para>

</para>

@group: 
@Returns: 


<!-- ##### FUNCTION gtk_radio_menu_item_new_with_label_from_widget ##### -->
<para>

</para>

@group: 
@label: 
@Returns: 


<!-- ##### FUNCTION gtk_radio_menu_item_new_with_mnemonic_from_widget ##### -->
<para>

</para>

@group: 
@label: 
@Returns: 


<!-- ##### MACRO gtk_radio_menu_item_group ##### -->
<para>
Deprecated compatibility macro. Use gtk_radio_menu_item_get_group() instead.
</para>



<!-- ##### FUNCTION gtk_radio_menu_item_set_group ##### -->
<para>
Sets the group of a radio menu item, or changes it.
</para>

@radio_menu_item: a #GtkRadioMenuItem.
@group: the new group.


<!-- ##### FUNCTION gtk_radio_menu_item_get_group ##### -->
<para>
Returns the group to which the radio menu item belongs, as a #GList of
#GtkRadioMenuItem. The list belongs to GTK+ and should not be freed.
</para>

@radio_menu_item: a #GtkRadioMenuItem.
@Returns: the group of @radio_menu_item.