Entry
How do i access multiple screens in tkinter? My GUI needs to be on 2 monitors.
Mar 31st, 2009 10:52
Scott Mandarich, Martin Franklin, nik heger,
The Tk Toplevel widget can take a screen option when you create it's
instance.
Example:
# left hand screen
top1 = Toplevel(root, screen=":0")
# right hand screen
top2 = Toplevel(root, screen=":1")
(this is untested as I only have one screen...)
If both screens are really only one screen (not sure how to describe
that) then setting the geometry on the toplevel instance would work
too.
Example:
top1 = Toplevel(root)
# top left corner of 'whole' screen
top1.geometry("+1+1")
# top right corner of 'whole' screen
top1.geometry("-1+1")
# bottom left corner of 'whole' screen
top1.geometry("+1-1")
# bottom right corner of 'whole' screen
top1.geometry("-1-1")
These can be added to the normal geometry size options like so:
# top right and full screen?? (if running 1024x768!)
top1.geometry("1024x768+1+1")
If you need to find out how big your screen is:
top1.winfo_vrootwidth()
top1.winfo_vrootheight()
http://www.golfgolfcourses.com/index.php?q=Iowa