public static interface Widget.UnmapEvent
In combination with Widget.VisibilityNotifyEvent
, this can be
used to detect whether a Window is actually currently presented to the
top of the stack and visible to the user:
private boolean up = false; ... final Window w; final Button b; ... w.connect(new Widget.VisibilityNotifyEvent() { public boolean onVisibilityNotifyEvent(Widget source, EventVisibility event) { if (event.getState() == VisibilityState.UNOBSCURED) { up = true; } else { up = false; } return false; } }); w.connect(new Widget.UnmapEvent() { public boolean onUnmapEvent(Widget source, Event event) { up = false; return false; } });thus allowing you to do something like:
b.connect(new Button.Clicked() { public void onClicked(Button source) { if (up) { w.hide(); up = false; } else { w.present(); up = true; } } });to intelligently toggle the visibility of the Window.
Note that you don't need Widget.MapEvent
here because the
the Widget.VisibilityNotifyEvent
will be tripped if you
come back to the workspace the Window is already on.
Modifier and Type | Method and Description |
---|---|
boolean |
onUnmapEvent(Widget source,
Event event)
Although this is an event-signal, this merely reports
information coming from the underlying X11 windowing system.
|