New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - How can I adjust the GUI based on Windows scale and resolution? #6016
Comments
I'm unsure of the underlying scaling, dithering, etc, algorithms that tkinter uses. It may be worth investigating to see what other users have said about their experiences using this feature. I've personally not used any of the scaling features. Were the elements cut off due to simply running out of screen space (i.e. not enough vertical pixels)? I think this is what you're referring to with "part of the window is not displayed correctly". |
To answer your question a little more directly...
Because the GUI is using raster, not vector, graphics, you are going to get some loss of quality when you scale up. It's just like enlarging an image. The process will create a loss of quality. As a developer, I think I would take the approach of developing code to run on the target machine specifically so that it has the best user experience. In other words, don't scale up. Write the code so that at 100% it will look right on the target platform. |
Type of Issue (Enhancement, Error, Bug, Question)
Question
Operating System
Windows (11)
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Python version: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
port: tkinter
tkinter version: 8.6.12
PySimpleGUI version: 4.60.1
Your Experience In Months or Years (optional)
Years Python programming experience
2 Years
Years Programming experience overall
3 Years
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
No
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
I created a GUI using PySimpleGUI which includes 2 windows, I work on a computer with a resolution of 1920x1080 when the scale is set to 100% and you can see the application well. Screenshot:
But when the scale is set to 150% I get this:
I found the following calculation designed to solve the problem of the scale between the computer on which the GUI is developed and the computer on which the GUI actually runs
When I run my code in the code plugin mentioned above, this is what I get:
As you can see, part of the window is not displayed properly and the resolution is compromised.
Is there a way to adjust the display of the GUI on the user's computer in such a way that it will be adjusted according to the resolution\SCALE defined on the screen on which the application ran without harming some of the widgets that appear in the GUI?
Code To Duplicate
Screenshot, Sketch, or Drawing
Example with 100% scale:
Example with 150% scale:
Watcha Makin?
A Monitor that controls our DSP.
The text was updated successfully, but these errors were encountered: