[GRASS-SVN] r52259 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jul 1 03:40:19 PDT 2012
Author: martinl
Date: 2012-07-01 03:40:18 -0700 (Sun, 01 Jul 2012)
New Revision: 52259
Modified:
grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: fix CoordinatesSelect - register handler (patch provided by Stepan Turek)
Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py 2012-07-01 10:30:44 UTC (rev 52258)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py 2012-07-01 10:40:18 UTC (rev 52259)
@@ -1935,7 +1935,7 @@
self.buttonInsCoords = buttons.ThemedGenBitmapToggleButton(parent = self, id = wx.ID_ANY,
bitmap = icon,
size = globalvar.DIALOG_COLOR_SIZE)
-
+ self.registered = False
self.buttonInsCoords.Bind(wx.EVT_BUTTON, self._onClick)
self._doLayout()
@@ -1957,11 +1957,13 @@
self.buttonInsCoords.SetToggle(False)
return
+ self.registered = True
self.lmgr.GetLayerTree().GetMapDisplay().Raise()
else:
if self.mapWin and \
self.mapWin.UnregisterMouseEventHandler(wx.EVT_LEFT_DOWN,
self._onMapClickHandler):
+ self.registered = False
return
self.buttonInsCoords.SetToggle(False)
@@ -1969,7 +1971,8 @@
def _onMapClickHandler(self, event):
"""!Gets coordinates from mapwindow"""
if event == "unregistered":
- self.buttonInsCoords.SetToggle(False)
+ if self.buttonInsCoords:
+ self.buttonInsCoords.SetToggle(False)
return
e, n = self.mapWin.GetLastEN()
@@ -1985,7 +1988,7 @@
def __del__(self):
"""!Unregistrates _onMapClickHandler from mapWin"""
- if self.mapWin:
+ if self.mapWin and self.registered:
self.mapWin.UnregisterMouseEventHandler(wx.EVT_LEFT_DOWN,
self._onMapClickHandler)
More information about the grass-commit
mailing list