Hi
I have a wxPyGridTableBase which I am attempting to get some cells to update
on a change from other cells. The code I have written changes the values,
but it seems that the cursor must be placed on the changed cell in order to
display the new value.
The "PipeUpdate(PipeGridData)" function performs the calculation on the
underlying data table.
As you can see I tried using the Grid1.ForceRefresh method, which gave me a
"global error grid1 not defined" error.
Using self.Grid1.ForceRefresh gave me a "Attribute error: wxFrame1 instance
has no attribute Grid1" error.
Any ideas?
TIA
Lynndon Harnell
Code snippet (Boa) is:-----------------
def create(parent):
return wxFrame1(parent)
[wxID_WXFRAME1, wxID_WXFRAME1GENBUTTON1, wxID_WXFRAME1GRID1,
wxID_WXFRAME1PANEL1] = map(lambda _init_ctrls: wxNewId(), range(4))
class wxFrame1(wxFrame):
_custom_classes = {'wxGrid':['dbGrid']}
def _init_utils(self):
pass
def _init_ctrls(self, prnt):
wxFrame.__init__(self, id = wxID_WXFRAME1, name = '', parent = prnt,
pos = wxPoint(233, 110), size = wxSize(455, 409), style =
wxDEFAULT_FRAME_STYLE, title = 'wxFrame1')
self._init_utils()
self.panel1 = wxPanel(id = wxID_WXFRAME1PANEL1, name = 'panel1',
parent = self, pos = wxPoint(8, 32), size = wxSize(424, 128), style =
wxTAB_TRAVERSAL)
self.genButton1 = wxGenButton(ID = wxID_WXFRAME1GENBUTTON1, label =
'genButton1', name = 'genButton1', parent = self, pos = wxPoint(160, 264),
size = wxSize(91, 40), style = 0)
self.grid1 = dbGrid(id = wxID_WXFRAME1GRID1, name = 'grid1', parent
= self.panel1, pos = wxPoint(8, 8), size = wxSize(408, 104), style =
wxDOUBLE_BORDER)
# EVT_KEY_DOWN(self.grid1, self.OnGrid1KeyDown)
# EVT_MOUSE_EVENTS(self.grid1, self.OnGrid1MouseEvents)
# EVT_GRID_CELL_LEFT_DCLICK(self.grid1, self.OnLeftDClick)
EVT_GRID_CELL_CHANGE(self.grid1, self.OnCellChange)
def __init__(self, parent):
self._init_ctrls(parent)
# def OnGrid1KeyDown(self, event):
# pass
def OnGrid1MouseEvents(self, event):
# pass
# def OnLeftDClick(self, event):
# pass
def OnCellChange(self, event):
PipeUpdate(PipeGridData)
# Grid1.ForceRefresh