I have a dual monitors set up (laptop screen and external monitor). My laptop screen is my primary display and external monitor is secondary. Both have different screen sizes.
In my python tkinter script, i have used winfo_screenwidth()
and winfo_screenheight()
to detect the screen width and height so that I can set the root window to become full screen.
Normally, when I run my script, the root window will be the size of my laptop screen. When i move the window to my extended monitor, I want it to auto adjust the width and height to match the external display's width and height.
Is this possible? Is there any way to check if the root window is in primary or secondary display?
Does winfo_screenwidth()
detect the width and height of the secondary display?
EDIT: I am using Windows XP Pro 32 bit & Python 2.7.
How I did it:
t = Tk() # new window
t.update()
t.attributes("-alpha", 00)
t.state('zoomed') # maximize the window
height= t.winfo_height() # ...
width= t.winfo_width()
But sadly I do not know of the location of the other screen. But I think you can do this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With