for i in xrange(len(self.controls)):
> pnl = wx.Panel(self.tab1, -1)
> bs = wx.StaticBox(pnl,-1, 'label)
> sz = wx.StaticBoxSizer(bs, wx.VERTICAL)
> tmpCtrl = createControl(parent=pnl)
> sz.Add(tmpCtrl, 0, wx.EXPAND | wx.ALL, 3)
You probably just want to use the grid's CreateGrid(rows, cols) method.
I'm not seeing anything else that I do in my programs...
Thank you Mike for your suggestion but I do use CreateGrid(). In my
createControl() function I do that:
def createControl(self, parent):
tmp = GridLabelCtrl(parent=pnl,
id=-1,
label='a label',
name='a name',
style=0)
tmp.CreateGrid(1,3)
tmp.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.updateValue)
return tmp
I suppose the problem lies in the gridsizer. If I set that sizer to be 1
column wide the grid displays correctly. If I set it to more than 1
column the space allocated to my subclassed grid is the same but now
there's the horizontal scrollbar cutting the lower part of the grid.
I put 2 images here:
http://www.emmexx.it/varie/grid1.jpg (gridsizer with 1 column)
http://www.emmexx.it/varie/grid2.jpg (gridsizer with 2 columns)
I think there's some command lacking somewhere in my code telling the
sizer: "hey! you must give more vertical space to the grid or it will
have to display a scrollbar".
bye
maxx