Hi, having some trouble setting up a grid sizer. Just can't find what
I'm doing wrong.
I've simplified the thing down to a form with 3 rows. First and second
row are text boxes while the third row has an edit box. I want the first
two rows to keep their original sizes whilst the third should grow in
both dimensions.
Any pointers would be appreciated.
This is my code, it does not work, whatever I do I keep expanding row 1
col 1 but never row 1 col 3 :
# -*- coding: utf-8 -*-
import dabo
dabo.ui.loadUI('wx')
class PnlEditor(dabo.ui.dPanel):
def afterInit(self):
gSzr = dabo.ui.dGridSizer(HGap=10, VGap=5)
lbl = dabo.ui.dLabel(self,
Caption='TextBox 1',
FontSize=12,
FontBold=False)
ctrl = dabo.ui.dTextBox(self)
gSzr.append(lbl, alignment=("top", "right"))
gSzr.append(ctrl)
lbl = dabo.ui.dLabel(self,
Caption='TextBox 2',
FontSize=12,
FontBold=False)
ctrl = dabo.ui.dTextBox(self)
gSzr.append(lbl, alignment=("top", "right"))
gSzr.append(ctrl)
lbl = dabo.ui.dLabel(self,
Caption='EditBox',
FontSize=12,
FontBold=False)
ctrl = dabo.ui.dEditBox(self)
gSzr.append(lbl, 'expand', alignment=("top", "right"))
gSzr.append(ctrl, 'expand')
gSzr.setColExpand(True, 1)
gSzr.setRowExpand(True, 2)
self.Sizer = dabo.ui.dSizer('v')
self.Sizer.append1x(gSzr, border=15)
class GSzrTest(dabo.ui.dForm):
def afterInit(self):
editPnl = PnlEditor(self)
self.Sizer = dabo.ui.dSizer('v')
self.Sizer.append1x(editPnl)
app = dabo.dApp()
app.MainFormClass = GSzrTest
app.start()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]