With tkinter canvas, to calculate the size of the graphics I display, I normally use the function winfo_screenwidth()
, and size my objects accordingly.
But when used on a system with two monitors, winfo_screenwidth()
returns the combined width of both monitors -- which messes up my graphics.
How can I find out the screen width in pixels of each monitor, separately?
I have had this problem with several versions of Python 3.x and several versions of tkinter (all 8.5 or above) on a variety of Linux machines (Ubuntu and Mint).
For example, the first monitor is 1440 pixels wide. The second is 1980 pixels wide. winfo_screenwidth()
returns 3360.
I need to find a way to determine the screenwidth for each monitor independently.
Thanks!