Re: [Java-gnome-developer] Glade file question
Brought to you by:
afcowie
From: Scott J. H. <ha...@ks...> - 2005-12-20 13:35:41
|
bas...@li... wrote: > Il giorno mar, 20/12/2005 alle 10.11 +1100, Andrew Cowie ha scritto: > On Mon, 2005-19-12 at 22:33 +0100, bas...@li... wrote: > >>>how can I load a particular >>>form, defined in my foo.glade, in which there are three forms (main, >>>search, about)? >> >> >>LibGlade glade = new LibGlade("foo.glade", this); >>.. >>Window mainForm = (Window) glade.getWidget("main"); >>Window searchForm = (Window) glade.getWidget("search"); >>Window aboutForm = (Window) glade.getWidget("about"); >> >>AfC >>Sydney >> > > > Thanks Andrew, but I have another thing to understand. In particular, when I load the glade file with > > LibGlade glade = new LibGlade("foo.glade", this); > > and launch the main, ALL forms are displayed! What about if I want to load a single form when I pressed a button? Are forms managed in the same class file? > Try the other constructor, which allows you to specify the window: LibGlade gladeMain = new LibGlade("foo.glade", this, "main"); //Loads main LibGlade gladeMain = new LibGlade("foo.glade", this, "search"); //Loads search LibGlade gladeMain = new LibGlade("foo.glade", this, "about"); //Loads about Scott. -- "Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra |