Ed,
We got this working...kind'a..
The DynamicSelectedPageNumber does not seem to fire after the init (i.e.
self.refresh)
What are we missing?
import dabo
dabo.ui.loadUI("wx")
import dabo.dEvents as dEvents
class KiloPanel(dabo.ui.dPanel):
def afterInit(self):
self.Sizer = hs = dabo.ui.dSizer("h")
hs.append(dabo.ui.dTextBox(self),)
hs.append(dabo.ui.dLabel(self,Caption='Kg'))
class LbsPanel(dabo.ui.dPanel):
def afterInit(self):
self.Sizer = hs = dabo.ui.dSizer("h")
hs.append(dabo.ui.dTextBox(self))
hs.append(dabo.ui.dLabel(self,Caption='Lbs'))
class Wtpgf(dabo.ui.dPanel):
def afterInit(self):
self.Sizer = hs = dabo.ui.dSizer("h")
#hs.append(dabo.ui.dLabel(self,Caption='hellow worl;d'))
pageFrame = pgf =
dabo.ui.dPageFrameNoTabs(self,DynamicSelectedPageNumber=self.GetDisplayMode,
RegID='WtPgf')
pgf.appendPage(pgCls=KiloPanel)
pgf.appendPage(pgCls=LbsPanel)
hs.append(pgf, 1,"x")
def GetDisplayMode(self):
return(self.Form.WtDisplayMode)
class TestForm(dabo.ui.dForm):
def afterInit(self):
self.WtDisplayMode=1
self.Sizer = dabo.ui.dSizer("vertical")
self.Sizer.append1x(Wtpgf(self))
self.Sizer.append(dabo.ui.dButton(self,Caption='Click
me',OnHit=self.clickme))
self.layout()
def clickme(self,evt):
### this works but we don’t want to have to call each object
every time
#if self.WtPgf.SelectedPageNumber == 1:
#self.WtPgf.SelectedPageNumber=0
#else:
#self.WtPgf.SelectedPageNumber=1
if self.WtDisplayMode:
self.WtDisplayMode=0
else:
self.WtDisplayMode=1
self.refresh()
evt.stop()
def main():
app = dabo.dApp()
app.MainFormClass = TestForm
app.start()
if __name__ == '__main__':
main()
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.7/816 - Release Date: 05/23/2007
3:59 PM
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]