Re: [gtk-list] Re: [OT] How to change button label ?!



Sven Anders wrote:
> 
> On Tue, 17 Aug 1999, Tom Gilbert wrote:
> 
> > * Sven Anders (anderss@fmi.uni-passau.de) [99081721:53]:
> >
> > > I'm missing one question in the FAQ:
> > >
> > >  How to change a button's label after it's creation ?!
> > >
> >
> > I use gtk_label_set_text( GTK_LABEL(label), "New text" );
> 
> But, who do I get to the label ?
> I have only the button !
> (I'm using glade and I dont want to edit the source code glade emit.)

Glade outputs a function called lookup_widget() which you can use to
get pointers to widgets. You need a pointer to any widget in the
window/dialog, and you pass it the name of the widget you want.

e.g.

  button = lookup_widget (GTK_WIDGET (menuitem1), "button1");

Damon



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