Re: [Java-gnome-developer] StatusBar issue + 2 questions
Brought to you by:
afcowie
From: Fred B. <cha...@ma...> - 2004-10-25 05:32:22
|
thanks :) 1) yup, I had noticed for the callbacks.. nifty thing. Didn't realize it wouldn't get the whole thing :\ 2) Doh me! I was just getWidget() on the window, then hide() it.. that's better though. 3) I will read up more for the StatusBar. fred ps: copying list. On Mon, 2004-10-25 at 00:36 -0400, Ray Auge wrote: > On Sun, 2004-10-24 at 21:49 -0500, Fred Blaise wrote: > > Hello all > > > > I am using the 2.6 libs from debian unstable. I am using eclipse 3.0 for > > my IDE. > > > > Questions first: > > 1) I have created a Window with glade, and I am tying it in my java code > > via LibGlade. No problem thus far, except that I don't understand that > > example > > (http://cvs.gnome.org/viewcvs/java-gnome/libglade-java/doc/examples/glade/LibGladeTest.java?rev=1.8&view=markup) > > > > I have tried it in my own code, but with no success. I have to do > > something like the following to be able to do something with my widgets: > > > > gladeXml = new LibGlade("/home/fblaise/Glade/jgLDAP/jgldap.glade",this); > > cboExistingConn = (ComboBox)gladeXml.getWidget("cboExistingConn"); > > > > If I don't getWidget() my object like this second line shows, despite > > the fact my widget has the same name in Glade and in my code, I just get > > a NullPointerException when I invoke anything on it. If anyone can shade > > some light.. I guess it'd very cool to not manually map each widget, and > > let LibGlade do it for you. > > I think what is happening in that particular example (and the reason you > don't have any getWidget()s in the code and yet it still works) is that > the glade file used in the example defined the callback functions it > needed and so libglade would auto attach them with those found in the > java code. Now, you still have to getWidget() if you want to do any kind > of widget manipulation cause the only things auto connected are > callbacks (which libglade will complain about if they don't exist in > your code). > > > > > 2) My glade project includes several windows. All my windows pop up when > > I start the program. Is there anyway to prevent that? > > >From glade(-2), for each window, choose the "Common" tab from the > "Properties" window and set "Visible" to "No". From your code you'll > then use the show[All]() and hide() methods on the desired window to ... > you know! > > > > > 3) The StatusBar problem: > > When I try to map my status bar like this: > > > > statbar1 = (StatusBar)gladeXml.getWidget("statbar1"); > > > > It tells me this: > > could not create widget: org.gnu.gtk.Statusbar > > If I recall this one is one of those gnome issues. There are special > "helper" classes for the Appbar, as it's called in libgnome-java, to > help you get the statusbar. I'd suggest reading the libgnome-java > javadocs a couple of times... It took me more than a couple times to get > it the first time... > > > > > Thanks :) > > > > fred > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > > Use IT products in your business? Tell us what you think of them. Give us > > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > > http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > java-gnome-developer mailing list > > jav...@li... > > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |