I would like the widgets on the window to expand as you expand the window. I know you can do it with the pack method but I'm using the grid method to arange my widgets.

Pack Method:

label = Label(root, text="Some Text")
label.pack(expand=1, fill=BOTH)

Grid Method I'm using:

self.inventoryLabel = Label(self.root, text="\nInventory")
self.inventoryLabel.grid(row=3, column=15, columnspan=15, rowspan=1)

You use rowconfigure and columnconfigure. If you comment one of them out in the following example, it will only expand in the direction of which ever was not commented.

    import Tkinter as tk     ## Python 2.x
except ImportError:
    import tkinter as tk     ## Python 3.x

def column_row_expandable():
    """ the labels and button will not expand when the top frame expands
        without the rowconfigure and columnconfigure statements
    top.rowconfigure(0, weight=1)
    for col in range(5):
        top.columnconfigure(col, weight=1)
        tk.Label(top, text=str(col)).grid(row=0, column=col, sticky="nsew")

    top.rowconfigure(1, weight=1)
    tk.Button(top, text="button").grid(row=1, column=0, columnspan=10, sticky="nsew")

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.