Python Forum
[Tkinter] grid layout
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] grid layout
#3
grid is a funny geometry. If you plan out your screen on a grid, it works well. It tends to be quite finicky.
to fill a frame, use

yourwidget.grid(..., sticky='nsew', ...)
in order to place your widgets properly, it's real important to know exactly how many columns you are going to use,
and to set the columns correctly. Also, it's good to use an odd number so you need to center.
It's next to impossible to get it right if you don't draw it out first using a 'Grid form' with row and columns marked.

I highly recommend looking at the book 'Python and Tkinter Programming' by John Grayson. This is an old book,
and actually went out of print, but it is so full of extremely valuable information that a new printing has been done.
(publisher Manning)

You can get a used version on amazon very inexpensively, and most if not all is on line, albeit copyright issues may apply.

Page 87 shows the perfect GUI layout form.

I was just playing around with this a little. You're grid rows and columns are too confusing.
Do you have a drawing showing row and column layout of each window?
It would be very helpful.
Reply


Messages In This Thread
grid layout - by neech - Oct-07-2016, 06:18 PM
RE: tkinter grid layout - by neech - Oct-07-2016, 09:05 PM
RE: tkinter grid layout - by Larz60+ - Oct-07-2016, 09:55 PM
RE: tkinter grid layout - by neech - Oct-07-2016, 11:55 PM
RE: grid layout - by Larz60+ - Oct-13-2016, 09:41 AM
RE: grid layout - by Yoriz - Oct-13-2016, 11:56 AM
RE: grid layout - by Larz60+ - Oct-13-2016, 10:07 PM
RE: grid layout - by Larz60+ - Oct-13-2016, 11:16 PM
RE: grid layout - by Larz60+ - Oct-14-2016, 07:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Grid layout and QHBox hobbyist 1 3,105 Jan-26-2021, 12:35 AM
Last Post: deanhystad
  pyqt5 layout Nickd12 8 3,521 Jan-18-2021, 09:09 AM
Last Post: Axel_Erfurt
  [Kivy] Weird spacing in grid layout test 3 3,475 Nov-08-2019, 04:37 PM
Last Post: Axel_Erfurt
  Python GUI layout off between different OS shift838 5 3,732 Jan-02-2019, 02:53 AM
Last Post: shift838

Forum Jump:

User Panel Messages

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