]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/grid.py
Compile fixes for Panther
[wxWidgets.git] / wxPython / wx / lib / mixins / grid.py
index f24b65058f62e9a92415bdf7a01c0b9ad3e3eb99..586d24eee5d27c7bec6dfd622a3d7f6ea3ddd954 100644 (file)
@@ -1,5 +1,5 @@
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------
-# Name:        wxPython.lib.mixins.grid
+# Name:        wx.lib.mixins.grid
 # Purpose:     Helpful mix-in classes for wx.Grid
 #
 # Author:      Robin Dunn
 # Purpose:     Helpful mix-in classes for wx.Grid
 #
 # Author:      Robin Dunn
@@ -34,20 +34,15 @@ class GridAutoEditMixin:
     """
 
     def __init__(self):
     """
 
     def __init__(self):
-        self.__enableEdit = 0
-        self.Bind(wx.EVT_IDLE, self.__OnIdle)
         self.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.__OnSelectCell)
 
 
         self.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.__OnSelectCell)
 
 
-    def __OnIdle(self, evt):
-        if self.__enableEdit:
-            if self.CanEnableCellControl():
-                self.EnableCellEditControl()
-            self.__enableEdit = 0
-        evt.Skip()
+    def __DoEnableEdit(self):
+        if self.CanEnableCellControl():
+            self.EnableCellEditControl()
 
 
     def __OnSelectCell(self, evt):
 
 
     def __OnSelectCell(self, evt):
-        self.__enableEdit = 1
+        wx.CallAfter(self.__DoEnableEdit)
         evt.Skip()
 
         evt.Skip()