瀏覽代碼

wxGUI: fix closing gui from menu

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53061 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 年之前
父節點
當前提交
199b89a595
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      gui/wxpython/lmgr/frame.py

+ 3 - 1
gui/wxpython/lmgr/frame.py

@@ -1766,7 +1766,9 @@ class GMFrame(wx.Frame):
                     else:
                         self.SaveToWorkspaceFile(self.workspaceFile)
                 elif ret == wx.ID_CANCEL:
-                    event.Veto()
+                    # when called from menu, it gets CommandEvent and not CloseEvent
+                    if hasattr(event, 'Veto'):
+                        event.Veto()
                     dlg.Destroy()
                     return
                 dlg.Destroy()