i'm trying to fetch the object of a cell (like wx.textctrl instance).
but i can't grab it. is there any way how i can get a single cell and have access to "cell.getvalue(), .getid() ..." etc?
i think i need to get the wx.gridcellattr - object, but how?
i’m trying to fetch the object of a cell (like wx.textctrl instance).
but i can’t grab it. is there any way how i can get a single cell and have access to “cell.getvalue(), .getid() …” etc?
i think i need to get the wx.gridcellattr - object, but how?
i know that, but i would like to get the object (where i can .GetId().. ). same
access like a normal wx.textctrl.
i think that the gridcell has nothing to do with wx.textctrl, but perhaps
there's a way how to get to the inizialised cell.
daniel
> From: DInversini <at> daetwyler.com> To: wxpython-users <at>
lists.wxwidgets.org> Date: Fri, 12 Dec 2008 13:58:57 +0100> Subject:
[wxpython-users] question on wxgrid, cell - own cell editor> > hi> > i'm trying
to fetch the object of a cell (like wx.textctrl instance).> but i can't grab it.
is there any way how i can get a single cell and have access to
"cell.getvalue(), .getid() ..." etc?> > i think i need to get the
wx.gridcellattr - object, but how?> > thanks for your answers> > daniel>
_______________________________________________> wxpython-users mailing list>
wxpython-users <at> lists.wxwidgets.org> http://lists.wxwidgets.org/mailman/listinfo/wxpython-usersJe foto's bewerken en
in elkaar laten overlopen met Windows Live Photo Gallery
i'm trying to fetch the object of a cell (like wx.textctrl instance).
but i can't grab it. is there any way how i can get a single cell and have access to "cell.getvalue(), .getid() ..." etc?
i think i need to get the wx.gridcellattr - object, but how?
thanks for your answers
daniel
I did a little digging and I think I might have found a solution. Check out the code below:
<code>
import wx
import wx.grid
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Simple Grid", size=(640,480))
grid = wx.grid.Grid(self)
self.Bind(wx.grid.EVT_GRID_EDITOR_CREATED, self.OnGridEditorCreated)
grid.CreateGrid(50,50)
for row in range(20):
for col in range(6):
grid.SetCellValue(row, col,
"cell (%d, %s)" % (row, col))
def OnGridEditorCreated(self, event):
""" Bind the kill focus event to the newly instantiated cell editor """
editor = event.GetControl()
print 'Editor methods:\n\n'
print dir(editor) event.Skip()
The cell editor's methods that get printed out in the OnGridEditorCreated event handler include GetId() and GetValue() methods (among others). I found this trick here: http://wiki.wxpython.org/wxGrid
Mike Driscoll <mike <at> pythonlibrary.org> writes:
The cell editor's methods that get printed out in the
OnGridEditorCreated event handler include GetId() and GetValue() methods
(among others). I found this trick here: wxGrid - wxPyWiki