java-gnome version 4.0.7

org.gnome.gtk
Interface Widget.UNMAP_EVENT

Enclosing class:
Widget

public static interface Widget.UNMAP_EVENT

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 VISIBILITY_NOTIFY_EVENT, 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.VISIBILITY_NOTIFY_EVENT() {
     public boolean onVisibilityNotifyEvent(Widget source, EventVisibility event) {
         if (event.getState() == VisibilityState.UNOBSCURED) {
             up = true;
         } else {
             up = false;
         }
         return false;
     }
 });
 
 w.connect(new Widget.UNMAP_EVENT() {
     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 MAP because the the VISIBILITY_NOTIFY_EVENT will be tripped if you come back to the workspace the Window is already on.

Since:
4.0.5
Author:
Andrew Cowie, Ryan Lortie

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

onUnmapEvent

boolean onUnmapEvent(Widget source,
                     Event event)
Although this is an event-signal, this merely reports information coming from the underlying X11 windowing system. It's information you can monitor, but don't try to block this signal. Return false!



java-gnome