Python Forum

Full Version: scaling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi ,
I have developed and installed an app with a Tkinter GUI .
I have made sure to detect the screen resolution of the user's PC (winfo_width and height),
ad resize everything if needed.
Works perfectly, except for one user who complained he could not see the bottom of the app window.

Turns out his "system/screen/personalisation" : scaling factor was at 125 %.

Any method to detect this and reset it to 100 % ? , or warn the user? He was not aware of it anyway.

thx,
Paul
You might be looking at this problem backward. Why are you checking window size and resolution? You should only care about the size of the window and the size of the view. If the window is too small to show the view you need to provide a way to scroll the view around to see the parts. It shouldn't matter if the window is too small because the screen is small, or if magnification is set, or if the user just resized the window to make it small. Your application should gracefully rescale to some reasonably small size that fits on anything.
Deanh,
I am trying to understand what you are writing, but I don't get it completely.
My development screen is 1920 x 1200. This user's screen is 1920x1080.
My window-resize function shows a perfectly 100% visible window on any PC, ON CONDITION
that the PC's screen/personalisation/scaling is at 100%. But I don't know that. Neither do most users.

Are you saying that i should write the Tkinter window for the smallest commercial screen available (probably 1920 x 1080)?
An extra parameter in this discussion is that I am showing scanned documents in part of the screen. The larger their screen,
the better they can read the (small) letters. (The scans are images, that I pixel-resize on the fly to fit the canvas)

But this takes me away from the original question: can I find out, programmatically, what value the scaling is on a particular PC ?
thanks,
Paul
The window should be resizeable.
OK, you mean:
root.resizable(height = True, width = True)
Yes, sort of a solution.
Pity that when I grab a corner, the resize is not proportional.
(unless I'm doing something wrong)
Buttons fall from the wayside.
I'll look into it some more.
thx,
Paul
For info: it would seem that pywinauto has been developed for similar issues.
(Don't ask me for details I'm not a user)
Paul
How do you position controls in your windows; place, pack or grid?
"Pack" it is.
Paul