gtkradiomenuitem.sgml 3.06 KB
Newer Older
Owen Taylor's avatar
Owen Taylor committed
1 2 3 4
<!-- ##### SECTION Title ##### -->
GtkRadioMenuItem

<!-- ##### SECTION Short_Description ##### -->
5
A choice from multiple check menu items
Owen Taylor's avatar
Owen Taylor committed
6 7 8

<!-- ##### SECTION Long_Description ##### -->
<para>
9 10 11 12
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>
13 14 15 16 17
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
18
this:
Owen Taylor's avatar
Owen Taylor committed
19
</para>
20 21 22
<example>
<title>How to create a group of radio menu items.</title>
<programlisting>
23
GSList *group = NULL;
24 25 26
GtkWidget *item;
gint i;

Matthias Clasen's avatar
Matthias Clasen committed
27
for (i = 0; i &lt; 5; i++)
28 29
{
  item = gtk_radio_menu_item_new_with_label (group, "This is an example");
30
  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
31 32 33 34 35
  if (i == 1)
    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
}
</programlisting>
</example>
Owen Taylor's avatar
Owen Taylor committed
36 37 38

<!-- ##### SECTION See_Also ##### -->
<para>
39 40 41 42 43 44
<variablelist>
<varlistentry>
<term>#GtkMenuItem</term>
<listitem><para>because a radio menu item is a menu item.</para></listitem>
</varlistentry>
<varlistentry>
45
<term>#GtkCheckMenuItem</term>
46 47 48
<listitem><para>to know how to handle the check.</para></listitem>
</varlistentry>
</variablelist>
Owen Taylor's avatar
Owen Taylor committed
49 50
</para>

Matthias Clasen's avatar
Matthias Clasen committed
51 52 53
<!-- ##### SECTION Stability_Level ##### -->


Owen Taylor's avatar
Owen Taylor committed
54 55
<!-- ##### STRUCT GtkRadioMenuItem ##### -->
<para>
56
The structure contains only private data that must be accessed through
57
the interface functions.
Owen Taylor's avatar
Owen Taylor committed
58 59 60
</para>


Soeren Sandmann's avatar
Soeren Sandmann committed
61 62 63 64 65 66 67
<!-- ##### SIGNAL GtkRadioMenuItem::group-changed ##### -->
<para>

</para>

@radiomenuitem: the object which received the signal.

Matthias Clasen's avatar
Matthias Clasen committed
68 69 70 71 72
<!-- ##### ARG GtkRadioMenuItem:group ##### -->
<para>

</para>

Owen Taylor's avatar
Owen Taylor committed
73 74
<!-- ##### FUNCTION gtk_radio_menu_item_new ##### -->
<para>
75
Creates a new #GtkRadioMenuItem.
Owen Taylor's avatar
Owen Taylor committed
76 77
</para>

78 79
@group: the group to which the radio menu item is to be attached
@Returns: a new #GtkRadioMenuItem
Owen Taylor's avatar
Owen Taylor committed
80 81 82 83


<!-- ##### FUNCTION gtk_radio_menu_item_new_with_label ##### -->

84 85 86 87 88 89 90 91 92 93
<!-- ##### FUNCTION gtk_radio_menu_item_new_with_mnemonic ##### -->
<para>

</para>

@group: 
@label: 
@Returns: 


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
<!-- ##### 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: 


123
<!-- ##### MACRO gtk_radio_menu_item_group ##### -->
Owen Taylor's avatar
Owen Taylor committed
124
<para>
Matthias Clasen's avatar
Matthias Clasen committed
125
Deprecated compatibility macro. Use gtk_radio_menu_item_get_group() instead.
Owen Taylor's avatar
Owen Taylor committed
126 127 128
</para>


129

Owen Taylor's avatar
Owen Taylor committed
130 131
<!-- ##### FUNCTION gtk_radio_menu_item_set_group ##### -->
<para>
132
Sets the group of a radio menu item, or changes it.
Owen Taylor's avatar
Owen Taylor committed
133 134
</para>

135
@radio_menu_item: a #GtkRadioMenuItem.
Matthias Clasen's avatar
Matthias Clasen committed
136
@group: the new group.
Owen Taylor's avatar
Owen Taylor committed
137 138


139 140
<!-- ##### FUNCTION gtk_radio_menu_item_get_group ##### -->
<para>
Matthias Clasen's avatar
Matthias Clasen committed
141 142
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.
143 144
</para>

145
@radio_menu_item: a #GtkRadioMenuItem.
Matthias Clasen's avatar
Matthias Clasen committed
146
@Returns: the group of @radio_menu_item.
147 148