OK, I'm new to all this, and I'm not having a fun time ...
I'm trying to use a wxGrid to enter various types of data. Some cells
have their attributes set to attr_noedit, but for the rest, I'd like
to have them go directly into edit mode when selected. So I have in
part:
def OnIdle(self, evt):
if self.edit==1:
if self.CanEnableCellControl():
self.EnableCellEditControl()
self.edit=0
This works, except where I have previously used:
self.SetCellEditor(row,k,wxGridCellNumberEditor()) or
self.SetCellEditor(row,k,wxGridCellFloatEditor())
Here, the self.EnableCellEditControl() doesn't seem to work (the cell
gets selected, but a second click is needed to edit it.
I'm trying to use a wxGrid to enter various types of data. Some cells
have their attributes set to attr_noedit, but for the rest, I'd like
to have them go directly into edit mode when selected.
Nice idea! I think I'll add a mix-in class to wxPython.lib.mixins...
def OnIdle(self, evt):
if self.edit==1:
if self.CanEnableCellControl():
self.EnableCellEditControl()
self.edit=0
This works, except where I have previously used:
self.SetCellEditor(row,k,wxGridCellNumberEditor()) or
self.SetCellEditor(row,k,wxGridCellFloatEditor())
Works for me. What platform and version are you on? Do the cells have
valid Number or Float values in them? If not there is an ASSERT that fires
in debug/hybrid mode, maybe there is a side effect of that you are seeing...
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!