replace:
Code: Select all
//destroy += exit_clicked
delete_event += exit_program
Code: Select all
//-- MU- this is called by the menu item --
def private exit_clicked ()
exit_program()
def private exit_program ():bool
if document_modified is true
var messagedialog = new MessageDialog (this, Gtk.DialogFlags.DESTROY_WITH_PARENT | Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, ("The file is unregistered, do you want to save it ?"))
messagedialog.run()
if (messagedialog.run () == ResponseType.YES)
save_clicked ()
Gtk.main_quit()
messagedialog.destroy()
else if (messagedialog.run () == ResponseType.NO)
Gtk.main_quit()
messagedialog.destroy()
else
Gtk.main_quit()
return false
If have made two functions of it, because the "delete_event" requires a boolean return value, but the menu item to quit does not.
Mark