I have a project created with the Class Designer. In the project I want
to have a function that can be called from various events such as button
onHit. I only want to place the function in the code once but can't
figure out the proper place to put it. The function in this instance is
'def updateEditBox( fpath )' and I've tried placing it into the .py file
that sets up the dabo app and calls the cdxml file but can't figure out
how to reference it from within the onHit event. If I bring up the
command window while the app is running I can call the function, just
not from the event itself. The error I get when I try is :
[EMAIL PROTECTED]:~/projects/daboprojects/FileLister> ./filelister.py
Dabo Info Log: Wed Nov 22 15:20:52 2006: 0 database connection
definition(s) loaded.
Dabo Info Log: Wed Nov 22 15:20:53 2006: User interface set to 'wx' by dApp.
Dabo Info Log: Wed Nov 22 15:20:54 2006: wxPython Version: 2.6.2.1 wxGTK
(unicode) (gtk2)
Traceback (most recent call last):
File "/home/bsnipes/bin/dabo/dabo/lib/eventMixin.py", line 97, in
raiseEvent
bindingFunction(event)
File "", line 187, in onHit
File "/tmp/tmpmfcM2z.py", line 20, in onHit_1
updateEditBox(fpath)
NameError: global name 'updateEditBox' is not defined
Also i find that I have to import modules like 'os' in the event
function in order to use their methods even though it is already
imported in my initial apps .py file. Is that normal?
Thanks,
Brian
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users