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.

It does do exactly what I expected to see.

Now for the implementation details:

I'll hold on on the cdxml, but eventually I want to use that too.   but given 
the cdxml just creates instances of dabo ui objects, that shouldn't matter.

What I am looking for is separation of UI from the object that the UI operates 
on: MyProp1, 2, and .swap().  Can be thought of as a business object.  I don't 
think we need to use a dabo BO class, but I could be wrong.  I should be able 
to 
run the swap method without having the gui brought up.



 >              dabo.ui.dTextBox(pan, Height=41, DataSource="self.Form",
 >                              DataField="MyProp1", RegID="txt1")
 >


So instead of DataSource="self.Form", I am expecting to see something like
DataSource="myObj"
or if I have to tie myObj to the form: DataSource="self.Form.myObj"
I think I tired that once, didn't get anywhere.


 >      def swap(self):
 >              self.MyProp1, self.MyProp2 = self.MyProp2, self.MyProp1
 >              self.update()

.update() needs to be called from somewhere that knows about the form, so 
either 
in the onHit_butSwap(self, evt): method (which seems a bit too close to the 
button) or maybe a form.swap() that calls myObj.swap() then .update().  For the 
next version, it can live in onHit_butSwap(self, evt).


 >              dabo.ui.dButton(pan, RegID="butSwap", Caption="Swap")
 >      def onHit_butSwap(self, evt):

Is the RegID what ties the button to the method?


Carl K



_______________________________________________
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