org.gnu.gtk.event
Interface LifeCycleListener
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 static void main( String[] argv ) {
Gtk.init( argv );
MyExample example = new MyExample();
Gtk.main();
}
public MyExample() {
Window window = new Window( WindowType.TOPLEVEL );
window.setTitle( "AboutDialogExample" );
window.addListener( new Life() );
window.showAll();
}
protected class Life implements LifeCycleListener {
public void lifeCycleEvent(LifeCycleEvent event) {}
public boolean lifeCycleQuery(LifeCycleEvent event) {
if (event.isOfType(LifeCycleEvent.Type.DESTROY) ||
event.isOfType(LifeCycleEvent.Type.DELETE)) {
Gtk.mainQuit();
}
return false;
}
}
}
LifeCycleEvent
lifeCycleQuery
public boolean lifeCycleQuery(LifeCycleEvent event)
This method is for the delete and destroy events.
TODO: document this properly.