|
java-gnome version 4.0.19 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Widget.UnmapEvent
The signal emitted when a Window becomes invisible. This happens in a variety of scenarios, notably when the Window is minimized, when you change workspaces, and as a Window is being destroyed.
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.
Method Summary | |
---|---|
boolean |
onUnmapEvent(Widget source,
Event event)
Although this is an event-signal, this merely reports information coming from the underlying X11 windowing system. |
Method Detail |
---|
boolean onUnmapEvent(Widget source, Event event)
false
!
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |