On Monday 23 April 2007 22:25, Paul McNett wrote:
> Carl Karsten wrote:
> > Is my example worth fixing, or should I start over?
>
> Not sure it'll help, because I'm not really sure if the cdxml part was a
> requirement for your example, but here's what I think you were trying to
> do, in pure Dabo (no cdxml). At least you can agree/disagree that it
> works to your spec, and we can go from there with the discussion.
>
> #-- begin code
>
> import dabo
> dabo.ui.loadUI("wx")
>
> class MyForm(dabo.ui.dForm):
>       def initProperties(self):
>               self.Caption = "Bind to BO Demo"
>               self.Top = 273
>               self.Height = 118
>               self.Width = 295
>               self.Left = 61
>
>               self.MyProp1 = "a"
>               self.MyProp2 = "b"
>
>
>       def afterInit(self):
>               pan = dabo.ui.dPanel(self)
>
>               dabo.ui.dTextBox(pan, Height=41, DataSource="self.Form",
>                               DataField="MyProp1", RegID="txt1")
>
>               dabo.ui.dButton(pan, RegID="butSwap", Caption="Swap")
>
>               dabo.ui.dTextBox(pan, Height=41, DataSource="self.Form",
>                               DataField="MyProp2", RegID="txt2")
>
>               hs = pan.Sizer = dabo.ui.dSizer("h")
>               hs.append(self.txt1, "expand")
>               hs.append(self.butSwap, alignment="Middle")
>               hs.append(self.txt2, "expand")
>
>               self.Sizer.append1x(pan)
>               self.update()
>
>       def onHit_butSwap(self, evt):
>               self.swap()
>
>       def swap(self):
>               self.MyProp1, self.MyProp2 = self.MyProp2, self.MyProp1
>               self.update()
>       def _getMyProp1(self):
>               return self._myProp1
>
>       def _setMyProp1(self, val):
>               self._myProp1=val
>
>       MyProp1 = property(_getMyProp1, _setMyProp1, None, "My Prop #1")
>
>       def _getMyProp2(self):
>               return self._myProp2
>
>       def _setMyProp2(self, val):
>               self._myProp2=val
>
>       MyProp2 = property(_getMyProp2, _setMyProp2, None, "My Prop #2")
>
> if __name__ == "__main__":
>       app = dabo.dApp(MainFormClass=None)
>       app.setup()
>       frm = MyForm()
>       frm.show()
>       app.start()
>
> #-- end code
where is the bindEvent for the button?  It works but I don't see where or how 
you bind the button to  onHit_butSwap(). 
-- 
John Fabiani


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to