Quit application when last window is closed

This commit is contained in:
Michael Becker 2014-07-10 00:39:28 -04:00
parent 69c552cf9d
commit fe9293ae80

View File

@ -17,6 +17,13 @@ namespace UniversalEditor.Engines.GTK
tbsDocumentTabs.RemovePage(0);
}
protected override bool OnDeleteEvent (Gdk.Event evnt)
{
Engine.CurrentEngine.Windows.Remove (this);
if (Engine.CurrentEngine.Windows.Count == 0) Application.Quit();
return base.OnDeleteEvent (evnt);
}
public IEditorImplementation GetCurrentEditor()
{
if (tbsDocumentTabs.Page < 0 || tbsDocumentTabs.Page >= tbsDocumentTabs.NPages) return null;