Re: Help with retreiving children?
- From: Vlad Harchev <hvv hippo ru>
- To: alaric portone com
- Cc: gtk-list gnome org
- Subject: Re: Help with retreiving children?
- Date: Tue, 22 Aug 2000 10:23:45 +0500 (SAMST)
On Mon, 21 Aug 2000 firstname.lastname@example.org wrote:
> Hi there...
> I am creating an app using GTK+... I don't like global variables, or
> exporting large numbers of variables to implement functionality.
> I have a form with multiple entries and combos and spin-buttons and I
> would like to be able to access those widgets without having a global
> variable for each.
> I'm thinking something along the line of using a function on the top-level
> widget to return a pointer to the requested child-widget (requested by
> name, since I did name all my widgets, and whats the point of names if
> this isn't it?)
> So if there's any functionality like this, or other suggestions, it would
> be greatly appreciated. I've been through the docs, unfortunately they're
> a bit sketchy on the more complex topics.
I would recomend you to (ab)use gtk_object_set_data/gtk_object_get_data,
in the toplevel widget, e.g.
and then, when ptr is needed, extract it like this:
GtkWidget* total_button =
in order to save typing, I always use the following macros:
> Thanks loads,
> gtk-list mailing list
] [Thread Prev