Re: Naming / Labelling Widgets



Isn't this exactly what the "Name: " field in glade is doing? Note
that naming by itself is not enough to get access to the widget by the
 name, but you also need to store a hash_table that maps the name to
the widgets. Since all widgets are GObjects that contain such a hash
table (through g_object_set_data(), g_object_get_data()) you may e.g.
create the hash table in the top widget. Add another pointer from all
widgets to the top widget and you may traverse the whole hierarchy
without adding additional variables. On the other hand if you use
libglade, I think you can get the mapping from name to widget directly
through one of its methods.

Regards,
Dov

On 4/6/06, Richard Plana <rplana zicorp com> wrote:
>  On Wed, 2006-04-05 at 18:51 -0400, Paul Davis wrote:
>  On Wed, 2006-04-05 at 16:38 -0600, Richard Plana wrote:
> > First, let me clarify a couple of things. When I say Widget name, I'm
> > referring to an arbitrary name given to a widget. It is NOT the name
> > returned by gtk_widget_get_name() (which, really, is the string
>
> only if you never called gtk_widget_set_name() on it. glade allows you
> to do this, IIRC, so that you can make widgets be called "Foobar" if you
> choose.
>
>
>  I think this is the route that I'd like to take. I've tried searching for
> this function in Glade-2 but haven't found it, yet. Can anyone point this
> out?
>
>  Thanks! The support is incredible.
>  --
>
>  Richi Plana
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
>
>



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