Tk covering the entire screen

Skip Montanaro skip.montanaro at gmail.com
Fri May 4 15:54:45 EDT 2018


I have a little typing watcher (buggy as can be, nearly 20 years old):

https://github.com/smontanaro/python-bits/tree/master/watch

It does the trick most of the time, so I ignore the bugs for the most part.

I had to drag it out last week after my wrists started flairing up again. I
moved it to Py3, and was running it on Linux, but as my desktop machine at
work is Windows, I think it was a bit blind to my activity in Windows-only
applications.

So, I revisited it on Windows. My cover window is a Tk Frame with width and
height defined like so:

    (w, h) = (self.winfo_screenwidth(), self.winfo_screenheight())

Unfortunately, I have three screens, so should have been using

    (w, h) = (self.winfo_vrootwidth(), self.winfo_vrootheight())

Those calls yield the correct values for w and h (5760 x 1200), but when
the watcher tells me it's time to rest, the covering frame only blanks the
middle and right hand screens. The left hand screen remains uncovered. (I
can't run it under Python 3 on Windows for various reasons, so am running
it with 2.7.14 via an Anaconda build.)

I suspect this is a Tk issue as much as anything, but this is the only
place I know to ask Tk questions. Any ideas?

Thx,

Skip



More information about the Python-list mailing list