Re: [gnome-love] Modifying widget's w/ libglade



On Fri, 2001-09-21 at 10:24, Cameron Matheson wrote:
Hey,

I wrote this little program (I'm trying to learn how to use libglade),
and what I'm trying to do, is make the text of a button change when the
button is clicked.  Unfortunately, I don't know how to access the
button's label in my signal-handler, could anyone tell me how that works
(maybe w/ example code?)

I've attached a program that changes the label on a button when you
click it. Not libglade stuff, but you can probably figure that part out
yourself.

The idea is the following: GtkButton is a GtkBin, and such a guy
contains a 'child', which in the case of a button, if the button was
created with new_with_label anyway, is a GtkLabel. So to get the label
you write GTK_LABLEL (GTK_BIN (button)->child).

        /mailund

-- 
A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and tequila.

Mitch Ratcliffe, "Technology Review" (1992)

Attachment: main.c
Description: Text Data



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