[GRASS-SVN] r58725 - grass/trunk/gui/wxpython/dbmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 14 10:22:44 PST 2014


Author: annakrat
Date: 2014-01-14 10:22:43 -0800 (Tue, 14 Jan 2014)
New Revision: 58725

Modified:
   grass/trunk/gui/wxpython/dbmgr/dialogs.py
Log:
wxGUI: fix for not closing of attribute dialog with wxPython 3 (#2162)

Modified: grass/trunk/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/dialogs.py	2014-01-14 17:09:28 UTC (rev 58724)
+++ grass/trunk/gui/wxpython/dbmgr/dialogs.py	2014-01-14 18:22:43 UTC (rev 58725)
@@ -156,7 +156,8 @@
         # bindigs
         btnReset.Bind(wx.EVT_BUTTON, self.OnReset)
         btnSubmit.Bind(wx.EVT_BUTTON, self.OnSubmit)
-        btnCancel.Bind(wx.EVT_BUTTON, self.OnCancel)
+        btnCancel.Bind(wx.EVT_BUTTON, self.OnClose)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -297,8 +298,8 @@
                     if name != key and id != wx.NOT_FOUND:
                         self.FindWindowById(id).SetValue(str(value))
 
-    def OnCancel(self, event):
-        """!Cancel button pressed
+    def OnClose(self, event):
+        """!Closes dialog and removes query layer.
         """
         frame = self.parent.parent
         frame.dialogs['attributes'] = None
@@ -310,7 +311,7 @@
             frame.RemoveQueryLayer()
             self.parent.UpdateMap(render = True)
 
-        self.Close()
+        self.Destroy()
 
     def OnSubmit(self, event):
         """!Submit records"""
@@ -340,7 +341,7 @@
             layer += 1
         
         if close and self.closeDialog.IsChecked():
-            self.OnCancel(event)
+            self.OnClose(event)
 
     def OnFeature(self, event):
         self.fid = int(event.GetString())



More information about the grass-commit mailing list