Hi All,
i’m having a wierd behavior with a ComboBox cell in a grid,
when i press a key (“2”) when on the cell, the combobox is opened but doesn’t search “2”
only after clicking again “2” the comboBox changes to “2”.
i have this small example:
import wx
import wx.grid as gridlib
···
#---------------------------------------------------------------------------
class CustomDataTable(gridlib.PyGridTableBase):
def init(self):
gridlib.PyGridTableBase.init(self)
self.colLabels = [‘number’]
self.dataTypes = [gridlib.GRID_VALUE_CHOICE+":1,2,3",
]
self.data = [
[‘1’],[‘2’],
]
required methods for the wxPyGridTableBase interface
def GetNumberRows(self):
return len(self.data)
def GetNumberCols(self):
return len(self.colLabels)
def IsEmptyCell(self, row, col):
try:
return not self.data[row][col]
except IndexError:
return True
def GetValue(self,row,col):
return self.data[row][col]
def SetValue(self, row, col, value):
self.data[row][col] = value
def GetColLabelValue(self, col):
return self.colLabels[col]
def GetTypeName(self, row, col):
return self.dataTypes[col]
if name == ‘main’:
app = wx.PySimpleApp()
frame = wx.Frame(None,-1)
grid = wx.grid.Grid(frame)
grid.SetTable(CustomDataTable())
frame.Show(True)
app.MainLoop()
Thanks for any ideas on how to solve this.