Re: radio button label



How do you get a label from a gtkradiobutton?

This is how I do it (I think you really have to check 
each radio button for TRUE or FALSE):
Carlos
-------------------------------------------
button = gtk_radio_button_new_with_label (NULL, "Whatever");
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 5);
gtk_object_set_data (GTK_OBJECT (dialog), "radio_button1", button);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (callback_function), window);
gtk_widget_show (button);

and then in the callback_function:
button = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (dialog), "radio_button1");
if (GTK_TOGGLE_BUTTON (button)->active == TRUE)
button = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (dialog), "radio_button2");
if (GTK_TOGGLE_BUTTON (button)->active == TRUE)
etc...
_____________________________________________




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]