Re: GtkBuilder Public API - Last call
- From: Tristan Van Berkom <tvb gnome org>
- To: Murray Cumming <murrayc murrayc com>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>, Johan Dahlin <jdahlin async com br>
- Subject: Re: GtkBuilder Public API - Last call
- Date: Tue, 26 Jun 2007 10:32:09 -0400
On Tue, 2007-06-26 at 13:50 +0200, Murray Cumming wrote:
> On Tue, 2007-06-26 at 14:19 +0300, Kalle Vahlman wrote:
> > 2007/6/26, Murray Cumming <murrayc murrayc com>:
> > > libglade's _new() function has a "root" parameter:
> > > http://developer.gnome.org/doc/API/libglade/gladexml.html#GLADE-XML-NEW
> > >
> > > This is necessary because libglade otherwise instantiates all the items
> > > in the file. Does GtkBuilder instead only instantiate the objects when
> > > you actually use gtk_builder_get_object()?
> >
> > See bug 447998 for discussion on this:
> >
> > http://bugzilla.gnome.org/show_bug.cgi?id=447998
> >
> > but in short: no, it instantiates them as a part of the
> > parsing/building process and it's not going to be easy to do it
> > properly otherwise.
>
> OK, so we need to have one file per window, which the glade-3 developers
> might not be so happy about. I guess, the gtk-builder-convert script
> should be changed to create lots of individual files.
>
> I am concerned that this makes it impossible to use GtkBuilder to define
> the properties for a single widget, without instantiating a useless
> invisible window object. That's a technique that I use currently.
I vaguely remember having discussed this issue a little, we found
that yes; many apps do use the "root" argument but that it was not
fundamental to the way gtkbuilder works (i.e. people can simply store
widgets/objects in separate files). I suppose this functionality could
be added to the builder in the future by adding a "rootnode" property
to the builder if its really needed.
For your particular use case though, you dont need to instantiate
a useless window; there's no need for toplevel ui objects to be
GTK_TYPE_WINDOW().
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]