GTK+ 3 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <gtk/gtk.h> struct GtkRadioMenuItem; GtkWidget * gtk_radio_menu_item_new (GSList *group
); GtkWidget * gtk_radio_menu_item_new_with_label (GSList *group
,const gchar *label
); GtkWidget * gtk_radio_menu_item_new_with_mnemonic (GSList *group
,const gchar *label
); GtkWidget * gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group
); GtkWidget * gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group
,const gchar *label
); GtkWidget * gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group
,const gchar *label
); void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item
,GSList *group
); GSList * gtk_radio_menu_item_get_group (GtkRadioMenuItem *radio_menu_item
);
GObject +----GInitiallyUnowned +----GtkWidget +----GtkContainer +----GtkBin +----GtkMenuItem +----GtkCheckMenuItem +----GtkRadioMenuItem
GtkRadioMenuItem implements AtkImplementorIface, GtkBuildable, GtkActivatable and GtkActionable.
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.
The group list does not need to be freed, as each GtkRadioMenuItem will remove itself and its list item when it is destroyed.
The correct way to create a group of radio menu items is approximatively this:
Example 79. How to create a group of radio menu items.
1 2 3 4 5 6 7 8 9 10 11 |
GSList *group = NULL; GtkWidget *item; gint i; for (i = 0; i < 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); } |
GtkWidget * gtk_radio_menu_item_new (GSList *group
);
Creates a new GtkRadioMenuItem.
|
the group to which the radio menu item is to be attached. [element-type GtkRadioMenuItem] |
Returns : |
a new GtkRadioMenuItem |
GtkWidget * gtk_radio_menu_item_new_with_label (GSList *group
,const gchar *label
);
Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
|
. [element-type GtkRadioMenuItem][transfer full] |
|
the text for the label |
Returns : |
A new GtkRadioMenuItem. [transfer none] |
GtkWidget * gtk_radio_menu_item_new_with_mnemonic (GSList *group
,const gchar *label
);
Creates a new GtkRadioMenuItem containing a label. The label
will be created using gtk_label_new_with_mnemonic()
, so underscores
in label
indicate the mnemonic for the menu item.
|
group the radio menu item is inside. [element-type GtkRadioMenuItem] |
|
the text of the button, with an underscore in front of the mnemonic character |
Returns : |
a new GtkRadioMenuItem |
GtkWidget * gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group
);
Creates a new GtkRadioMenuItem adding it to the same group as group
.
|
An existing GtkRadioMenuItem |
Returns : |
The new GtkRadioMenuItem. [transfer none] |
Since 2.4
GtkWidget * gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group
,const gchar *label
);
Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
The new GtkRadioMenuItem is added to the same group as group
.
|
an existing GtkRadioMenuItem |
|
the text for the label |
Returns : |
The new GtkRadioMenuItem. [transfer none] |
Since 2.4
GtkWidget * gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group
,const gchar *label
);
Creates a new GtkRadioMenuItem containing a label. The label will be
created using gtk_label_new_with_mnemonic()
, so underscores in label
indicate the mnemonic for the menu item.
The new GtkRadioMenuItem is added to the same group as group
.
|
An existing GtkRadioMenuItem |
|
the text of the button, with an underscore in front of the mnemonic character |
Returns : |
The new GtkRadioMenuItem. [transfer none] |
Since 2.4
void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item
,GSList *group
);
Sets the group of a radio menu item, or changes it.
|
a GtkRadioMenuItem. |
|
the new group. [element-type GtkRadioMenuItem] |
GSList * gtk_radio_menu_item_get_group (GtkRadioMenuItem *radio_menu_item
);
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.
|
a GtkRadioMenuItem |
Returns : |
the group
of radio_menu_item . [element-type GtkRadioMenuItem][transfer none]
|
"group"
property"group" GtkRadioMenuItem* : Write
The radio menu item whose group this widget belongs to.
Since 2.8
"group-changed"
signalvoid user_function (GtkRadioMenuItem *radiomenuitem,
gpointer user_data) : Run First