Re: radio button label
- From: Carlos Pereira <carlos pehoe civil ist utl pt>
- To: gtk-app-devel-list gnome org
- Subject: Re: radio button label
- Date: Thu, 19 Oct 2000 22:00:56 +0100
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]