Changing the size of a Button

Miki miki.tebeka at
Sun Mar 9 19:11:12 CET 2008

Hello Konrad,

> How do i change the size of a Button
> (using Tkinter), other than to set it
> during construction?
In Tkinter, usually the geometry managers (such as pack) are the ones
who size the widgets.
If you run something like:
    import Tkinter as tk

    root = tk.Tk()
    def change_size():
        b["text"] = "More text"

    b = tk.Button(root, text="Text", command=change_size)


You'll see that the button changes size to accommodate the new text.

Miki <miki.tebeka at>

More information about the Python-list mailing list