0

My problem is when somebody runs my tkinter gui (in Windows 7) and has larger display settings (125%), the gui doesn't look well (buttons are closer to each other, end of text cannot be seen, etc.). I use place method with x - y coordinates to place the widgets.

Maybe using pack method could solve this, but it is easier to use place for me, because there are lots of labels and buttons with exact places.

Another solution can be if the display settings could be checked with pywin32 and resize everything if needed. If it is possible, please confirm and help, what is the related function or if you have any other idea/advice, please share it.

solari
  • 43
  • 8

1 Answers1

0

This is one of the reasons why place is a poor choice. You should switch to using grid and/or pack. They are specifically designed to handle different screen sizes, different resolutions, different widget styles, and different fonts.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • I believed grid doesn't preserve the scales (or proportions), but it does. I try to redesign my gui with that and we'll see, thank you. – solari Mar 02 '17 at 13:57
  • My main problem with grid is that my gui is based on this page switching solution: [link](http://stackoverflow.com/questions/14817210/using-buttons-in-tkinter-to-navigate-to-different-pages-of-the-application) and I have widgest on the main page (MainView) what are always on top and others what are used only in subpages and the widgets look jumbled, because the rows and columns are counted from 0, because they are in different containers. For example, if I want to put something in the 2nd column, it will be in the 1st and will be covered by a main widget. What is the best solution here? – solari Mar 06 '17 at 08:48
  • It seems the solution is grid_columnconfigure(index, **options) and grid_rowconfigure(index, **options) with pad option. Your other answer helped in a related topic: [link](http://stackoverflow.com/questions/14946963/tkinter-grid-how-to-position-widgets-so-they-are-not-stuck-together). – solari Mar 06 '17 at 11:34