Paul McNett wrote:
> Carl Karsten wrote:
>>> Where are these files again? Please don't point me to the list archives, 
>>> as I can't easily copy/paste code from that webpage.
>> Oh yeah, that whole html eats whitespace thing...
>>
>> hnmm, looks like I botched the file name too. - was called bd1, renamed the 
>> files to cdxml2objDemo1 but didn't change dabo.ui.createForm()
>>
>> http://dev.personnelware.com/carl/temp/May31/a/cdxml2objDemo1.tgz
> 
> Ok, your code runs, and when I click "swap" it swaps. What's the problem?
> 

I am trying to replace this code in this file:

# cdxml2objDemo1-code.py
## *!* ## Dabo Code ID: dButton-dForm
def onHit(self, evt):
self.Form.myObj1.swap()
self.Form.update()

With something in the cdxml file that connects the button to myObj1.swap() in a 
similar way that the text box's are connected to the attributes.  (once that 
happens, the displaced .update() can be dealt wtih.)

there are a few reasons I think this is a good thing.

1. less code = less bugs.  less code for me to write, less dabo code that has 
to 
  work.  I already burned an hour or so trying to figure out why my exe didn't 
work: the foo-code.py file didn't get copied, and the resulting app didn't 
error 
- I hit the button, and nothing happened.  I can see how that is my fault and 
not a bug in dabo, but it is an example of one more thing to deal with.

2. cdxml2objDemo1-code.py is not self documenting.  in my real code, I had all 
of 2 buttons, and at one point I mixed up which block of code was connected to 
witch button, so the debugging code I added confused me even more than the bug.

3. one less thing to 'learn'.  I am not confidant in my understanding of how 
the 
cdxml2objDemo1-code.py code gets connected to the UI controls.  given that I 
don't see much point to it, I don't see much point in taking the time to learn 
about it.

4. To me it is poor style to have code in the UI, and I thought Ed claimed the 
x-code.py file was just for the convince of the developer that wanted to edit 
code using the Dabo CD.

Assuming this is correct:
 >>     Just add that line to the object's afterInit() method.
(which it isn't - object, [event], and .myMethod need to be replaced with the 
right names, and my object doesn't have an afterInit() method.  but assuming it 
is correct anyway...)

It seems awkward to have to have the BO layer attach itself to the UI objects, 
especially when some of the UI object attach themselves to the BO object (like 
the text box.)  Not to mention that means you can't use that BO object without 
the UI, unless you write some conditional code, which seems beyond awkward.

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