[Gtk-sharp-list] Opening new Windows

Bruno Fernandez-Ruiz brunofr@olympum.com
Sat, 08 Nov 2003 20:06:44 +0200


On Sat, 2003-11-08 at 18:32, Met @ Uber wrote:
> This is seemingly simple, but I just cannot find it.  I created an
> application using glade and can easily get it to load via Glade.XML(). 
> But in that same glade file I have another window (AboutWin).  Upon
> clicking a button, how do I open that other window, which is defined in
> the same glade file?
> 

You need to create a new instance of Glade.XML per unique toplevel
widget. For example, given that "project.glade" is a resource in your
assembly:

XML gxml1 = new Glade.XML (null,
	  "project.glade",
	  "AboutDialog",
	  null);
Dialog dialog = (Dialog) gxml1["AboutDialog"];
gxml1.Autoconnect (...);

XML gxml2 = new Glade.XML (null,
	  "project.glade",
	  "MainWindow",
	  null);
Window window = (Window) gxml2["MainDialog"];
gxml2.Autoconnect (...);

Bruno

-- 
Bruno Fernandez-Ruiz <brunofr@olympum.com>
The Olympum Group,  http://www.olympum.com