Re: [Java-gnome-developer] Thanks and some questions
Brought to you by:
afcowie
From: Mikael H. <mi...@im...> - 2003-06-29 20:30:25
|
s=C3=B6n 2003-06-29 klockan 19.49 skrev Mark Wielaard: > Hi, Hi! Haven't tried out the bindings myself (had some problems building the .jar-files and didn't have time to look into it), will soon though. I've been a GNOME developers for several years though. > The org.gnu.gnome.About class doesn't seem to work correctly.=20 Why is org.gnu.gnome namespace used anyway? org.gnome.* looks more correct. > In general the library doesn't behave very nicely when calls are made > in the wrong order or are given the wrong arguments. Often it wasn't > that hard to see what went wrong or when I object should no longer be > used but crashing the whole application instead of throwing > IllegalStateExceptions makes debugging a bit harder then necessary. > An example is using a widget from a window which close box has just > been pressed. This might be the underlying GTK+ that makes this hard. Since C/GTK+ doesn't have ref counts as in Java I'm not sure if the fact that you keep a java ref on an object makes you have a gtk-ref on the C-object. My guess is that you have to be careful how you use the widgets and that you will have to explicitly call g_object_ref (not sure if that is wrapped or not) to keep a reference to a widget in a closed window after destroying the window but I'm not sure. > When using the UIInfo class to get some standard widget like > UIInfo.quitItem() when you try to call quitMenuItem.getWidget() before > the window that it is attched to is shown it crashes. Is this know > behaviour? Might be that the item/widget isn't created yet? > I couldn't find documentation about how to work with java-gnome from > multiple threads. To be save I just created a Fireable and a Timer > that sets off a couple times a second and then update the Widgets in > the fire() method that checks progress flags set in other threads. > What is the recommended way to handle multiple thread that want to > update the GUI. When is it save to call a widget or other glib, gtk or > gnome object from a thread that isn't the main gtk thread? When working with GTK+ you need to make sure that only one thread at a time work on a widget. Therefor you will have to create locks around calls that updates the widgets to prevent several simultanious accesses to a widget. > For the window layout I tried following the Gnome HIG. Is there > example code to do some of the things described there? Currently I use > alot of VBoxes inside HBoxes with different borders and spacing values > tied together with SizeGroups which seems to make it look like the HIG > describes. But since every Gnome application implements these kinds of > things I wondered if there isn't an example library that just does the > right thing. You probably want to work with Glade/Libglade (not sure if it is wrapped in java-gnome yet) for doing that. Most GNOME applications today use Glade to create the GUI in a GUI-editor which outputs an XML-file describing the UI. This saves lots of code and makes your application more maintainable since you can change the UI without touching the code. Hope it helps even though I don't know the current status of java-gnome. Regards, Mikael Hallendal --=20 Mikael Hallendal mi...@im... Imendio http://www.imendio.com Phone: +46 (0)709 718 918 |