Re: determining which radiobutton is active?
- From: carlos pehoe civil ist utl pt (Carlos Pereira)
- To: gtk-app-devel-list gnome org
- Subject: Re: determining which radiobutton is active?
- Date: Thu, 21 Aug 2003 00:28:12 +0100 (WEST)
Can anyone guide me to some example code that shows
how to dertermin which button is active in a group of
radiobuttons?
In function:
menu_item = gtk_radio_menu_item_new_with_label (NULL, "Apples");
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_object_set_data (GTK_OBJECT (dialog), "radio_button_apples", menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (
gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item)), "Oranges");
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_object_set_data (GTK_OBJECT (dialog), "radio_button_oranges", menu_item);
gtk_widget_show (menu_item);
In callback:
button = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (dialog), "radio_button_apples");
if (GTK_TOGGLE_BUTTON (button)->active == TRUE) do_apples (data);
etc...
Carlos
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]