|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LifeCycleListener
This is the listener interface for receiving life cycle realted events for a Widget.
An example of using this class to manage the life cycle events of an application would be as follows:
public class MyExample { public MyExample() { Window window = new Window(); window.setTitle("AboutDialogExample"); window.addListener(new LifeCycleListener() { public void lifeCycleEvent(LifeCycleEvent event) {} public boolean lifeCycleQuery(LifeCycleEvent event) { if (event.isOfType(LifeCycleEvent.Type.DELETE) { Gtk.mainQuit(); } return false; } } window.showAll(); } public static void main(String[] args) { Gtk.init(args); new MyExample(); Gtk.main(); } }If, on the other hand, you are trying to intercept window closure, you listen for the DELETE signal, do your alternate logic, and then return true. This tells GTK that you have handled the event-signal and that it is not to further propagate the signal which means that the default handler (which in turn emits a DESTROY signal and releases the resources) will not be called.
LifeCycleEvent
Method Summary | |
---|---|
void |
lifeCycleEvent(LifeCycleEvent event)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the project API is an algorithmic mapping of the underlying native libraries. |
boolean |
lifeCycleQuery(LifeCycleEvent event)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the project API is an algorithmic mapping of the underlying native libraries. |
Method Detail |
---|
void lifeCycleEvent(LifeCycleEvent event)
LifeCycleEvent
, with the
exception of "delete" and "destroy"; see
below
.
boolean lifeCycleQuery(LifeCycleEvent event)
LifeCycleEvent.Type.DELETE
) and "destroy" (represented by
LifeCycleEvent.Type.DESTROY
) event signals.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |