private void expand_Clicked(object Sender, EventArgs e) { GalleryPopupWindow popup = new GalleryPopupWindow(this); popup.ShowAll(); int x, y; ParentWindow.GetRootOrigin(out x, out y); x += Allocation.X; y += Allocation.Y; popup.GdkWindow.Move(x, y); }
private void OnButtonReleased(object o, ButtonReleaseEventArgs args) { if(popup != null) { Grab.Remove(popup); Gdk.Pointer.Ungrab(0); Gdk.Keyboard.Ungrab(0); popup.Hide (); popup.Destroy(); popup = null; } }
private void expand_ValueChanged(object Sender, EventArgs e) { if(expand.Value) { popup = new GalleryPopupWindow (this); popup.Realized += delegate { int x, y; ParentWindow.GetOrigin (out x, out y); x += Allocation.X; y += Allocation.Y; popup.GdkWindow.Move (x, y); }; popup.Hidden += delegate { expand.ValueChanged -= expand_ValueChanged; expand.Value = false; expand.QueueDraw (); expand.ValueChanged += expand_ValueChanged; }; popup.Show (); popup.ButtonReleaseEvent += OnButtonReleased; popup.AddEvents ((int) Gdk.EventMask.ButtonPressMask); Grab.Add(popup); Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true, Gdk.EventMask.ButtonReleaseMask, null, null, 0); if(grabbed == Gdk.GrabStatus.Success) { grabbed = Gdk.Keyboard.Grab(popup.GdkWindow, true, 0); if(grabbed != Gdk.GrabStatus.Success) { Grab.Remove(popup); popup.Hide (); popup.Destroy(); popup = null; return; } } else { Grab.Remove(popup); popup.Hide (); popup.Destroy(); popup = null; } } else { if (popup != null) { Grab.Remove(popup); popup.Hide (); popup.Destroy(); popup = null; } } }
private void expand_Clicked(object Sender, EventArgs e) { GalleryPopupWindow popup = new GalleryPopupWindow (this); popup.ShowAll (); int x, y; ParentWindow.GetRootOrigin (out x, out y); x += Allocation.X; y += Allocation.Y; popup.GdkWindow.Move (x, y); }