i have dual monitors set (laptop screen , external monitor). laptop screen primary display , external monitor secondary. both have different screen sizes.
in python tkinter script, have used winfo_screenwidth() , winfo_screenheight() detect screen width , height can set root window become full screen.
normally, when run script, root window size of laptop screen. when move window extended monitor, want auto adjust width , height match external display's width , height.
is possible? there way check if root window in primary or secondary display?
does winfo_screenwidth() detect width , height of secondary display?
edit: using windows xp pro 32 bit & python 2.7.
how did it:
t = tk() # new window t.update() t.attributes("-alpha", 00) t.state('zoomed') # maximize window height= t.winfo_height() # ... width= t.winfo_width() but sadly not know of location of other screen. think can
- create new window
- use winfo_screenheight() , winfo_screenwidth() find out original screen
- use geometry() move window around
- maximize window (it should maximize @ screen is)
- get geometry()
- if geometry @ (0, 0) main screen, proceed 3.
- you found screen
Comments
Post a Comment