[Java-gnome-developer] Glade and reusing a window
Brought to you by:
afcowie
From: Stefan P. <pr...@tz...> - 2005-08-13 15:18:33
|
Hi all, I have some problems using Glade for dialogs. I guess I'm on a wrong track somewhere, but I can't figure out where. I have built a smale glade application with two windows - a normal one (mainWindow) and a dialog window (adventWindow). I load them like that glade = new LibGlade("dsadb-tool.glade", this); mainWindow = (Window) glade.getWidget("MainWindow"); At first that lead to both windows showing up immediatly, but I figures that setting adventWindow to invisible stopped that. mainWindow contains a menu and one menu option triggers the display of the dialog window: public void on_abenteuer_activate() { System.out.println("on_abenteuer_activate"); adventWindow = (Window) glade.getWidget("AdventWindow"); adventWindow.show(); } Fine so far. The adventWindow-Dialog has a cancel button to close the dialog again. It also has the usual button "x" on (the top right) window frame to close the window. The cancel button triggers a call to adventWindow.hide() which works fine and allows me to call the show method again (even without re-retrieving the widget from Glade). My problem is: If I close the window with the "x"-Button on the frame the window closes but cannot be re-used. (java-gnome:32635): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed (java-gnome:32635): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `glong' (java-gnome:32635): GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed (java-gnome:32635): GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT (object)' failed (java-gnome:32635): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed I guess the glade instance of the window has been destroyed and cannot be reclaimed. I figured that I need to reload the whole glade file again, which is not very satisfying. What can I do to prevent this from happening? Or is there at least a way to disable the "x" button for the window? Regards, Stefan -- Stefan Prelle <pr...@tz...> |