Explorar o código

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á %!s(int64=12) %!d(string=hai) anos
pai
achega
199b89a595
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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()