Python Forum
[Tkinter] scaling
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] scaling
#1
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#2
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.
Reply
#3
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#4
The window should be resizeable.
Reply
#5
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#6
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#7
How do you position controls in your windows; place, pack or grid?
Reply
#8
"Pack" it is.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Scaling text QLabel following display mode windows '100%, 125% ...) VIGNEAUD 2 2,255 Jul-07-2021, 06:38 PM
Last Post: deanhystad
  Tkinter scaling windows conten to or with its size not working Detzi 5 4,441 Jan-12-2020, 12:42 PM
Last Post: Detzi
  [Tkinter] Ignore windows scaling in tkinter Gangwick 2 4,447 Jul-23-2018, 02:41 PM
Last Post: Gangwick

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020