tkinter blues (greens, reds, ...)

Steve Holden steve at holdenweb.com
Fri Oct 28 14:13:06 EDT 2005


Sean McIlroy wrote:
> hi all
> 
> i recently wrote a script that implements a puzzle. the interface
> mostly consists of a bunch of colored disks on a tkinter canvas. the
> problem is that the disks change their colors in ways other than the
> way they're supposed to. it certainly isn't just a bug in my script,
> since i can sometimes change the color of certain disks just by taking
> focus off of the window and then bringing it back again! does this
> sound like some known bug in tkinter? and if so, is there a recommended
> way of working around it? if it matters, i'm using python 2.3 under
> windows 95. any advice will be much appreciated.
> 
It sounds to me much more like a bug in your script, to me at least. 
Change of focus generates windowing events in much the same way as 
clicking a button or hitting a key does, so I don't understand why you 
think that "just [by] taking the focus off the window and bringing it 
back again" shouldn't change anything.

For more specific insights we'd need to see some code, but sometimes 
just changing your own focus from "Tkinter has a bug" to "my code has a 
bug" is enough to help one find out what the problem really is. If you 
have a soft toy I'd recommend you sit it down somewhere and explain to 
it in great detail exactly why it can't be a bug in your program. You 
may find you discover the error with no further assistance.

If not, fire the toy and ask again :-)

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list