|
|||||||||
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)
This method is for all void-returning life cycle related event signals. |
boolean |
lifeCycleQuery(LifeCycleEvent event)
This method is for the "delete" (represented by LifeCycleEvent.Type.DELETE ) and "destroy" (represented by
LifeCycleEvent.Type.DESTROY ) event signals. |
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 |