Python tkinter screen width and height secondary display -


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

  1. create new window
  2. use winfo_screenheight() , winfo_screenwidth() find out original screen
  3. use geometry() move window around
  4. maximize window (it should maximize @ screen is)
  5. get geometry()
  6. if geometry @ (0, 0) main screen, proceed 3.
  7. you found screen

Comments