Re: [gtk-list] Re: Button labels.





On Wed, 13 Oct 1999, Gustavo Carneiro wrote:

> On Tue, 12 Oct 1999, Sean Cody (TDR-X) wrote:
> 
> ;Can they be changed once they have been made??
> ;
> ;gtk_button_new_with_lable("Lable One");
> ;
> ;Something happens and this button now means something completely
> ;different... aka (connect/disconnect)
> ;
> ;MyButton->label = gtk_label_new("Label 2"); ?????????
> ;
> ;Or is it not worth the trouble and just replace the button with a newly
> ;created one?
> ;
> 
> I think you can reach the label widget inside the button as:
> 	GTK_BIN(button)->child
> Once you have the label, you can just change its text.
> 

You can change the text of a button with this:

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


Ted Roth



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