浏览代码

wxGUI/mapwindow: adding missing attribute into initialization of cursors

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57419 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 11 年之前
父节点
当前提交
4731c33a67
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 11 5
      gui/wxpython/gui_core/mapwindow.py

+ 11 - 5
gui/wxpython/gui_core/mapwindow.py

@@ -148,15 +148,21 @@ class MapWindow(object):
             wx.EVT_MOUSE_EVENTS : []
             }
 
-        # available cursors:
+        # available cursors
         self._cursors = {
-            "default" : wx.StockCursor(wx.CURSOR_ARROW),
-            "cross"   : wx.StockCursor(wx.CURSOR_CROSS),
-            "hand"    : wx.StockCursor(wx.CURSOR_HAND),
-            "pencil"  : wx.StockCursor(wx.CURSOR_PENCIL),
+            "default": wx.StockCursor(wx.CURSOR_ARROW),
+            "cross": wx.StockCursor(wx.CURSOR_CROSS),
+            "hand": wx.StockCursor(wx.CURSOR_HAND),
+            "pencil": wx.StockCursor(wx.CURSOR_PENCIL),
             "sizenwse": wx.StockCursor(wx.CURSOR_SIZENWSE)
             }
 
+        # default cursor for window is arrow (at least we rely on it here)
+        # but we need to define attribute here
+        # cannot call SetNamedCursor since it expects the instance
+        # to be a wx window, so setting only the attribute
+        self._cursor = 'default'
+
         wx.CallAfter(self.InitBinding)
 
     def __del__(self):