java-gnome version 4.0.19

org.gnome.gtk
Interface Window.DeleteEvent

Enclosing class:
Window

public static interface Window.DeleteEvent

This signal arises when a user tries to close a top level window. As you would expect, the default handler for this signal destroys the Window.

If you want to prevent a Window from being closed, connect this signal, and return true. Often the reason to do this is to pop up a notification Dialog, for example asking you if you want to save an unsaved document. Another technique is reusing a Window: rather than going to all the trouble to create this Window again, you can just temporarily hide it by calling Widget's hide().

Likewise, if you are going to take a long time to tear down the resources used by the Window or application as a whole (often the case when the user clicks on the [X] button in the window decorations), it is a good idea to call hide() immediately. Many window managers will popup a warning dialog asking you if you want to force-terminate the application if a window is perceived to be "unresponsive" to a close request. You can avoid this by simply hiding the Window while you clean up.

This signal is actually "delete-event" which lives on GtkWidget. That, however, is for implementation reasons in GTK because all the GdkEvents go to GtkWidget even though this particular signal only has to do with Windows. So, we expose it here.

Since:
4.0.0
Author:
Andrew Cowie, Devdas Bhagat

Method Summary
 boolean onDeleteEvent(Widget source, Event event)
           
 

Method Detail

onDeleteEvent

boolean onDeleteEvent(Widget source,
                      Event event)


java-gnome