I want to create a Tkinter
window but the following code does not line up with the top left corner of the screen:
import tkinter
class FullScreenWindow(tkinter.Frame):
def __init__(self):
self.root = tkinter.Tk()
w = self.root.winfo_screenwidth()
h = self.root.winfo_screenheight()
x = 0
y = 0
self.root.geometry('%dx%d+%d+%d' % (w, h, x, y))
self.root.mainloop()
if __name__ == "__main__":
app = FullScreenWindow()
Can anyone let me know why? I thought geometry was measured from the top left corner.
Note that when I run PIL.ImageGrab.grab(bbox = (0,0,100,100))
the screen captures from the top left corner correctly.
I'm running Python 3.4 on Windows 10.
Edit: This is actually an issue with Windows 10. Pop-up windows (including the windows spawned by tkinter) are moved a few pixel to the right. For now I'll just manually nudge the windows to the left.