public MainWindow() : base(WindowType.Toplevel) { var control = new MyControl(); SetDefaultSize(400, 300); Add(control); ShowAll(); DeleteEvent += (sender, e) => { Application.Quit(); e.RetVal = true; }; }