Adding method to a class on the fly
John Henry
john106henry at hotmail.com
Sat Jun 23 12:06:36 EDT 2007
>
> > But then how do I create the on_Button1_mouseClick function?
>
> That depends on what it is supposed to do, but in general you want a
> factory function -- a function that returns functions. Here's a simple
> example:
>
<snip>
Steven,
May be I didn't explain it clearly: the PythonCard package expects to
see a function by the name of on_Button1_mouseClick. I don't do
anything to register the callback function. The package assumes that
there is a function by that name whenever I create a button named
Button1. So, if I don't use exec, how can I create a function by that
exact name?
More information about the Python-list
mailing list