Ed Leafe wrote:
On Jan 10, 2006, at 8:06 PM, Don Taylor wrote:
I have designed a small app UI with the Designer and saved it as a
runnable app which gives me a Python module that invokes the .cdxml
file. I can see how to write event routines that get embedded within
the .cdxml module, but I can't figure out how to call other Python
classes and methods from the event routines because I don't know
where to specify the import statememnts for external modules. The
only place that I can see would be in the onActivate method of the
dForm object.
Is this where you intended this sort of thing to take place?
This seems to be a limit of the Python compile function. To use
other modules, add the import statement right after the 'def' statement
for any and all functions defined in the Designer. Unfortunately, since
each method is compiled individually, if you use a module in several
methods, you need to add the import statement into each one.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
Ed:
If I do this then I seem to run into a path problem, my module
'foobar.py' is in the same directory as the rest of the pieces of this
app, but it is not being found:
Traceback (most recent call last):
File
"C:\PYTHON24\Lib\site-packages\Dabo-0.5-py2.4.egg\dabo\lib\eventMixin.py"
, line 87, in raiseEvent
bindingFunction(event)
File "", line 2, in onHit
ImportError: No module named foobar
Don.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users