def PreExit(self):
msg = 'GriPy Application is preparing to terminate....'
log.info(msg)
print '\n', msg
OM = ObjectManager(self)
if OM.get_changed_flag():
dial = wx.MessageDialog(self.GetTopWindow(),
'Do you want to save your project?',
'GriPy',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION
)
if dial.ShowModal() == wx.ID_YES:
self.on_save()
#
self.reset_ObjectManager()
#
app_UI_filename = self._gripy_app_state.get('app_UI_file')
Interface.save_UI_application_data(app_UI_filename)
user_UI_filename = self._gripy_app_state.get('user_UI_file')
Interface.save_UI_user_data(user_UI_filename)
# This time I choose not use the line below because there was a little
# freeze on exiting (1-2 seconds). Then I opted delegate it do compiler.
#UIM = UIManager()
#UIM.close()
UIM = UIManager()
UIM.PreExit()
# As indicated by https://forums.wxwidgets.org/viewtopic.php?t=32138
aui_manager = wx.aui.AuiManager.GetManager(self.GetTopWindow())
aui_manager.UnInit()
评论列表
文章目录