Python-tkinter and canvas tags
Eric Brunel
eric.brunel at pragmadev.com
Mon Apr 15 06:08:46 EDT 2002
JB wrote:
[snip]
> def handleEnter(self, event):
> self.canvasRef.itemConfig(CURRENT,
> fill=self.HLColor)
>
> When I run it this way, the events are definitely being handled, but I get
> an error stating that "NameError: Global name 'CURRENT' is not defined".
Errrr, maybe you forgot to do "from Tkinter import *" in your module?
CURRENT is just a constant defined in this module with the string value
'current', so you just have to do a "from Tkinter import *" to use it. You
may also just do an "import Tkinter" and use Tkinter.CURRENT instead of
just CURRENT. In other words, don't look for magic here: CURRENT is just a
constant variable like any other one, and getting a NameError using it just
means that you didn't do the right things to get it properly defined...
BTW, AFAIK, the method itemConfig on canvases does not exist; it's named
itemconfigure.
HTH
--
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
More information about the Python-list
mailing list