Re: GtkBuilder Public API - Last call



2007/6/13, Matthias Clasen <matthias clasen gmail com>:
On 6/13/07, Yevgen Muntyan <muntyan tamu edu> wrote:
>
> > Widgets which set a name in a constructor are already semi-broken
> > anyway. Widget names are supposed to be an application/user feature,
> > not something thats used in the implementation of a widget.
>
> Programmers are also not supposed to set style properties. Nevertheless
> it happens, and widget name is one of tools for that. It is a documented
> use which shouldn't break, isn't it?
> How do you draw the line between "implementation of a widget" and
> "an application" part exactly? Note that what you said makes it look
> like calling gtk_widget_set_name() by a widget implementation is
> not supposed to happen; while doing it by GtkBuilder is indeed right
> and good; is it quite logical? GtkBuilder is more a user than the widget?

GtkBuilder is just setting the name that was specified in the xml, so
it is not violating the principle that the widget name belongs to the
app/user, since
the xml is part of the app.

Furthermore, if my (admittedly quick) glance over how the object names
are handled is not misguided, GtkBuilder sets the name once and never
checks it again. It has an internal hash table in which it stores the
id in the xml and all lookups use that instead of referring to the
actual name.

So even if GtkBuilder sets the initial name to what is in the xml, you
should be able to change it afterwards to whatever you like without
everything going bork bork.

A quick test shows that I can indeed match my widget by the fancy name
I gave it in the code in a gtkrc, while the lookup returns the correct
object with the xml id.

So this shouldn't be a problem...

--
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi



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