Re: Creating dynamic window

Kevin Altis <[email protected]>
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
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

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.