0
votes

I'm having troubles aligning some python tkinter/ttk widgets on a small gui I'm making. My gui window has 4 "sections" which I'm representing with frames. I'm using the grid manager to populate each frame with it's respective labels, entries, comboboxes, etc. Frame2 (top right, or Cartesian quadrant 1) is the biggest. To conform to symmetry, I set the sticky option of all my frames as N+S+E+W. This created 4 frames that filled the entire space, where the top half of the window has two frames of equal size, and the bottom half of the window has two frames of equal size. My frames have a relief (RAISED) so there is a visual separation of each one.

MY PROBLEM

My frame1 (Cartesian quadrant 2) is the smallest frame, but, with grid, it matches frame2 in size. This is good, I wanted this. However, frame1 also has way fewer widgets than frame 2, and instead of aligning all widgets at sticky = NW (like all my other frames), it centers all of the widgets first. This results in the widgets having a huge padded boarder in the frame, making it look very uneven. I want the widgets to be in the NW boarder of my frame1, and just have open space in the frame below them.

Is there a grid method, or a concept I've missed? I've dug through tonnes of examples/forums/etc looking for a similar description of this issue. I hope I was clear enough, my code isn't in a very presentable state right now as I am just trying to generate my visual idea right now. If more info or code is needed I can post.

Thanks in advance, Chris.enter image description here

1

1 Answers

1
votes

It looks like you have six rows in your frame. Use grid_configure to set tne weight of the seventh row to be 1. Assuming all the other rows have a weight of zero, this extra row will expand to fill tne available space.