[Glade-users] Getting widget references in callback functions

Nick Hynes Nick Hynes" <admin@1site.co.nz
Thu, 18 Jan 2001 15:34:24 +1300


Hi all,

What's the recommended method for getting a widget reference in a callback,
where you need more than one widget?

Options:
========
    1/ Make widget handles global.
    2/ Put all the handles you need into a struct,
       and use the user_data to pass a pointer to
       that struct.
    3/ ...?

Can you get a widget handle by name? Perhaps this is
possible if you have a handle to a parent widget?

e.g. gtk_container_get_child( cont, "button4" );

1 & 2 are both awkward, and require changing auto-
generated files. Is there a better solution?


Regards,
Nick Hynes.