public Note() : base("Add Note") { SetWmclass("SparkleShare", "SparkleShare"); IconName = "org.sparkleshare.SparkleShare"; Resizable = false; WindowPosition = WindowPosition.CenterAlways; BorderWidth = 16; SetSizeRequest(480, 120); DeleteEvent += delegate(object o, DeleteEventArgs args) { Controller.WindowClosed(); args.RetVal = true; }; KeyPressEvent += delegate(object o, KeyPressEventArgs args) { if (args.Event.Key == Gdk.Key.Escape || (args.Event.State == Gdk.ModifierType.ControlMask && args.Event.Key == Gdk.Key.w)) { Controller.WindowClosed(); } }; Controller.HideWindowEvent += delegate { Application.Invoke(delegate { Hide(); }); }; Controller.ShowWindowEvent += delegate { Application.Invoke(delegate { if (Child != null) { Remove(Child); } CreateNote(); ShowAll(); Present(); }); }; Controller.UpdateTitleEvent += delegate(string title) { Application.Invoke(delegate { Title = title; }); }; }
private void OnClosing(object sender, CancelEventArgs cancel_event_args) { Controller.WindowClosed(); cancel_event_args.Cancel = true; }