Skip to content Skip to sidebar Skip to footer

A Label In A Frame In A Window Won't Stretch, Why?

I would like to display a window with a single Frame and a Label in the Frame which would stretch to the whole width of the window The following code import Tkinter as tk root =

Solution 1:

Specifying sticky option when you call grid (e = east, w = west). Otherwise the widget in the cell is center-aligned.

upper_frame.grid(row=0, column=0, sticky='ew')
..
mylabel.grid(row=0, column=0, sticky='ew')

enter image description here


Post a Comment for "A Label In A Frame In A Window Won't Stretch, Why?"