Home > Software engineering >  Tkinter Grid Manager Frame/Canvas to Fill to Bottom of Root Window
Tkinter Grid Manager Frame/Canvas to Fill to Bottom of Root Window

Time:05-02

I have the following setup. A root window. In that root window I have the first 3 rows (0-2) of buttons and labels. This is all good. Below that I use a frame, that holds a canvas, that holds a scrollbar and another frame that is populated with a bunch of labels and buttons. This all works.

But I cannot figure out how to make that canvas or frame to extend to the bottom of the screen. (the black area). I have tried playing with the sticky and also grid_columnconfigure but I cannot understand the arrangement needed. A solution and an explanation will be greatly appreciated!

Note: The first 0-2 rows will not show up with anything as the below code run dies not include the button and label widgets. But what I need is for the black area to expand to the bottom of the root window. I believe the solution will be independent of the populating widgets

enter image description here

And next it needs sticky="news" for this frame and canvas.

self.frame_canvas.grid(row=self.TABLESTARTROW, column=0, sticky='news', columnspan=self.NUM_COLS)

self.canvas.grid(row=0, column=0, sticky='news')

enter image description here


Tested on Linux

  • Related