[java-gnome-hackers] LifeCycleEvent delete/Destroy
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2003-06-24 17:37:29
|
Hi, The handling of Delete and destroy GtkWidget signals seems odd at the moment. They both should return boolean values for whether to propagate the signal further. At the moment, destroy always returns true and delete always returns false. This seems odd to me, but I am not a Gtk expert. Could somebody please explain why we do this? What do the events mean to a java application. One thing I've noticed is that most of the example applications have window.addListener(new LifeCycleListener() { public void lifeCycleEvent(LifeCycleEvent event) { if (event.isOfType(LifeCycleEvent.Type.DESTROY)) Gtk.mainQuit(); } }); When the window is closed (by pressing the close button), the window disapears, but Gtk.mainQuit is not called, so the application does not terminate. This can be fixed by looking for the DELETE event also. Also, how can we write an application so that when the close button is pressed, a method can be called (e.g. pop up a window asking if changes should be saved) before the window disappears, and the disappearance of the window can be determined by the results of that method? -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |