Re: GtkBuilder Public API - Last call

Kalle Vahlman wrote:
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.

And widget isn't part of the app? Such separation is meaningless for
purpose of answering the question "should we change code of given
widget if we want the widget to be usable with GtkBuider?"

So, if a widget sets its name to modify its style, then
it's broken? Even if the style is essential part of its functionality?
E.g. text cursor color is not something fancy, it's an essential part
of text widget and it rather sucks if cursor is invisible because of
wrong styles. Saying "it's broken because it is somehow
not a part of application" just doesn't make sense.

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.

I said already what could be a problem. get_widget_by_name()
is irrelevant.


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