Tkinter Designer

← tkinter how-to

How do I add a circular meter or gauge in tkinter?

There is no gauge in the standard library — a plain tkinter progress bar is the nearest thing. ttkbootstrap provides Meter, a circular dial with the value written in the centre and an optional caption underneath.

# pip install ttkbootstrap
import ttkbootstrap as ttkb

app = ttkb.Window(themename="litera")

gauge = ttkb.Meter(
    app,
    amountused=42,
    amounttotal=100,
    subtext="CPU",
    metertype="semi",       # or "full" for a complete ring
    bootstyle="info",
)
gauge.pack(padx=20, pady=20)

app.mainloop()

Updating it as work progresses

configure sets a new value, and step moves it by an amount relative to where it is now. Both redraw the dial immediately, so a meter driven from a loop needs the usual care about keeping the interface responsive rather than any special handling of its own.

gauge.configure(amountused=75)   # jump to a value
gauge.step(5)                    # nudge it along -> 80

Reading the value back

Ask for the option with cget, not the attribute. Reaching for gauge.amountused looks natural and raises AttributeError on current versions, which is a common surprise because plenty of examples online were written against an older release.

There is also a variable behind the dial, which is useful when something else should follow the value. Recent versions renamed it: amount_used_var is current, and the older amountusedvar still works but warns that it goes away in 3.0.

gauge.cget("amountused")     # 80.0
gauge.amount_used_var.get()  # 80.0 — the DoubleVar behind it

Letting the user drag it

A Meter is display-only by default. Passing interactive=True turns it into an input the user can drag, which suits a volume or brightness control — but it is not what you want for something reporting progress, where a draggable dial invites confusion.

When a progress bar is the better choice

A meter earns its space on a dashboard, where the number is the point and there is room for a dial. For "this is taking a while", a plain progress bar reads faster, takes a fraction of the room and needs no extra package.

Doing it without the lookup

The Meter is in the palette when the project targets ttkbootstrap, with the value, total and caption as inspector fields. Switch the project to plain tkinter or CustomTkinter and the designer will tell you the widget has no equivalent there, rather than exporting something that will not import.

Lay the window out visually and read the generated Python as you go.

Open the tkinter designer →

Related questions