[GRASS-SVN] r54996 - in grass/trunk/gui/wxpython: gui_core mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 11 01:54:47 PST 2013


Author: annakrat
Date: 2013-02-11 01:54:47 -0800 (Mon, 11 Feb 2013)
New Revision: 54996

Modified:
   grass/trunk/gui/wxpython/gui_core/query.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
Log:
wxGUI: close query dialog properly

Modified: grass/trunk/gui/wxpython/gui_core/query.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/query.py	2013-02-11 08:59:36 UTC (rev 54995)
+++ grass/trunk/gui/wxpython/gui_core/query.py	2013-02-11 09:54:47 UTC (rev 54996)
@@ -43,9 +43,10 @@
             self._load()
 
         close = wx.Button(self.panel, id = wx.ID_CLOSE)
-        close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
+        close.Bind(wx.EVT_BUTTON, lambda event: self.Close())
         copy = wx.Button(self.panel, id = wx.ID_ANY, label = _("Copy to clipboard"))
         copy.Bind(wx.EVT_BUTTON, self.Copy)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
 
         hbox = wx.BoxSizer(wx.HORIZONTAL)
         hbox.AddStretchSpacer(1)
@@ -114,6 +115,11 @@
             wx.TheClipboard.SetData(do)
             wx.TheClipboard.Close()
 
+    def OnClose(self, event):
+        self.Destroy()
+        event.Skip()
+
+
 def test():
     app = wx.PySimpleApp()
     import pprint

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2013-02-11 08:59:36 UTC (rev 54995)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2013-02-11 09:54:47 UTC (rev 54996)
@@ -735,8 +735,13 @@
             self.dialogs['query'].SetData(result)
         else:
             self.dialogs['query'] = QueryDialog(parent = self, data = result)
+            self.dialogs['query'].Bind(wx.EVT_CLOSE, self._oncloseQueryDialog)
             self.dialogs['query'].Show()
 
+    def _oncloseQueryDialog(self, event):
+        self.dialogs['query'] = None
+        event.Skip()
+
     def _queryHighlight(self, vectQuery):
         """!Highlight category from query."""
         cats = name = None



More information about the grass-commit mailing list