Re: Help with retreiving children?

On Mon, Aug 21, 2000 at 02:32:58PM -0400, wrote:

> 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?)

Glade, a Gnome GUI builder, takes a very similar approach.  There's a
function supplied with each glade project that accepts a widget and a
widget-name.  This function walks the widget->parent chain to the top
of the widget hierarchy, searches all children for a widget with a
matching widget-name, and returns a pointer to that widget.  The
widget-names are set at widget creation time using the
gtk_widget_set_data() function.

You might want to prototype your app using Glade.  This would give you
a working example of this approach, and you may well end up liking the
glade-generated code well enough to use in the production version of
your application.

-- John Kodis.

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