[Glade-users] Best Practice for Glade.XML - open/close new window

Travis Staloch wrote:


Thanks for your help.  I've modified my code so that all of the windows are opened up at startup and then 
hidden/shown as needed.  This seems alot snappier than before and has helped in that regard.  However, it 
has caused a couple of problems.  The first, a minor problem, is that you can see all of the windows open up 
for a split second and then hide at startup.  Here's how each  window now gets created at init.  I'm keeping 
Gtk.Window references to each of the windows using this method:

protected Gtk.Window getWindowHandle(string sWindowName)
 Glade.XML gxml = new Glade.XML(sPATH_TO_GLADE_XML,sWindowName, null);
 gxml.Autoconnect (this);
 Gtk.Window wnd = (Gtk.Window)gxml.GetWidget(sWindowName);
 return wnd;

Is there a better way to create these windows, especially one that keeps them from being initially shown?  

Set the visible property of the window to false in the glade editor.

Also, is there a better way to use the Glade.XML rather than creating/destroying for each window I want to 
open?  Can I reuse the same Glade.XML and ask it for different windows?

No, libglade doesnt do that, gtk builder plans to though.

The second problem is that some of control references don't seem to work now.  I believe that the problem 
results from having named all my back and next buttons the same (btnBack, btnNext).  And now that I've 
Autoconnect()ed to each of the windows consecutively, the last in the list is the only one which remains 
connected.  Does that sound right?

No, signals are implicitly attached to the object without any name 
reference, and if you are
only parsing one hierarchy at a time, then there is no conflict in your 

I am drawing a blank on this one for the moment.


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