Re: Label issue of toggle buttons...



>I created a new toggle button..
>
>gtk_toggle_button_new_with_label("ON");
>
>now how do I change the label to "OFF" when the button is toggled?
>
>I tried creating new labels in each loop of the call back function but culdn't
> get the desired thing..

for 1.2, there are 2 ways:

a) 

   GtkWidget* label = gtk_label_new ("ON"):
   GtkWidget* button = gtk_button_new ();
   
   gtk_container_add (GTK_CONTAINER(button), label);

   ...
   
   gtk_label_set_text ("OFF")

b) 

   GtkWidget* button = gtk_button_new_with_label ("ON");

   ...

   gtk_label_set_text (GTK_LABEL(GTK_BIN(button)->child), "OFF");




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