Re: differences between Glade and GtkBuilder

2009-12-02 Thread Tristan Van Berkom
On Wed, Dec 2, 2009 at 6:52 PM, Shawn Bakhtiar wrote:
[...]

Note that this list is about the development of GTK+ itself, please address
gtk-app-devel-list
or gtk-list in the future for help using the GTK+ apis.


> I'm almost certain, that with glade you would load the xml (containing many
> top levels), then, call get the object you wanted out (which at that time it
> would construct and realize the widget making it visible)
>
> It seems with GtkBuilder loading the XML and realizing it are done in the
> same step, which makes it so that each individual top level has to be in its
> own file?
> Does it not make more sense to have a function that load the XML without
> realizing anything, then, as objects are requested, doing the actual
> construction and realization?
>


FYI libglade and GtkBuilder work the same way in this respect;

Parsing the file builds the widget hierarchy.

If your widgets are getting realized in the process of parsing
the file, it means that one of your toplevel widgets is set to be
visible at startup time (as the builder/libglade sets the toplevel to
be visible, this triggers the realize) - you can deffer the realization
of your widgets by building the toplevels in your project with the
"visible" property set to False (and then showing/realizing them at a later
time)

Cheers,
   -Tristan
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


RE: differences between Glade and GtkBuilder

2009-12-02 Thread Shawn Bakhtiar



Yes. They are all set to visible.

I'll change them in the GUI and see if that makes a difference.
I still think something in the process has changes, at least from the "user" 
perspective. 
I'm almost certain, that with glade you would load the xml (containing many top 
levels), then, call get the object you wanted out (which at that time it would 
construct and realize the widget making it visible)
It seems with GtkBuilder loading the XML and realizing it are done in the same 
step, which makes it so that each individual top level has to be in its own 
file? Does it not make more sense to have a function that load the XML without 
realizing anything, then, as objects are requested, doing the actual 
construction and realization?



 EMAILING FOR THE GREATER GOOD
Join me

> Subject: Re: 
> From: sc...@asofyet.org
> Date: Wed, 2 Dec 2009 13:37:42 -0500
> To: shashan...@hotmail.com
> 
> 
> On Dec 1, 2009, at 1:01 PM, Shawn Bakhtiar wrote:
> 
> > Previously, I was able to open a Glade XML file with multiple top level 
> > windows, and only load the specific window I wanted from within that file. 
> > I have tried to re-write this routine, however, every time a call is made 
> > to gtk_builder_add_from_file it not only loads the file but it also loads 
> > and displays ALL the windows in that file. 
> > 
> > Should this not work like glade did before, where you would load the file, 
> > then call the objects you wanted to be displayed?
> 
> Do you have the "visible" property set for all of the windows in the 
> buildable xml?
> 
> glade would also always construct all of the windows in the xml, but i think 
> there was a default to *not* visible.  (It would also construct them only 
> when you parse the xml, so if you let them be destroyed, you had to parse the 
> file again.  I haven't used buildable enough to tell you if it behaves that 
> way.)
> 
> 
> --
> I've been using emacs for 20+ years and have barely touched lisp.  I wouldn't 
> know lambda calculus if it took all its clothes off and waved a placard that 
> reads "I am lambda calculus" in blinking 48-point Comic Sans.
>   -- Dave Hodgkinson, on london.pm
> 
  ___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list