From: Kevin A. <al...@se...> - 2007-06-24 22:01:04
|
On Jun 24, 2007, at 12:32 PM, John Henry wrote: > Thanks for the response. > > The code almost worked. The offending line is: > > function.func_name = "on_%s_mouseClick" % name > > which is a TypeError violation (readonly attribute). > I ran into this too when I try to set method.__name__ > directly. > Hmm, the code I sent to the list worked perfectly on my machine. Did you try and run the code as is? Which version of Python are you using? I was trying it with 2.4.3 on a Mac, but if you're using 2.5 maybe they added additional flags you're supposed to use at the command-line so that Python doesn't give you a warning?! I'm also a bit confused about the multiple args. I added the line... print "You clicked '%s'." % event.target.name to show that the event being passed in is what we're expecting and again on my box it works as expected. ka |