Floodgauge#
Floodgauge is a progress-bar variant that ttkbootstrap ships
(ttk.Floodgauge) — a filling bar with text drawn over it, useful for
showing progress with an inline label or percentage. It supports the same
determinate and indeterminate modes as a progress bar. This page is the complete lookup reference.
Each option can be passed to the constructor and changed later with
configure().
Options#
Option |
Type |
Description |
|---|---|---|
|
|
The color of the bar and text — one of |
|
|
The current progress value. Default |
|
|
The value at which the bar is full. Default |
|
|
|
|
|
Static text drawn over the bar. Default |
|
|
A template that overrides |
|
|
The font of the overlaid text. Default |
|
|
|
|
|
The long dimension of the gauge in pixels. Default |
|
|
The short dimension of the gauge in pixels. Default |
Methods#
- start(interval=None)
Begin the animation — a bouncing block in indeterminate mode, or an auto-increment in determinate mode.
- Parameters:
interval – milliseconds between steps (defaults to 20 ms indeterminate, 50 ms determinate).
- Returns:
None.
- stop()
Stop the animation started by
start().- Returns:
None.
- step(amount=1)
Increment the value by
amount, wrapping back to the minimum after passingmaximum.- Parameters:
amount – the amount to add (default
1).- Returns:
None.
- value
The current progress value (property; equivalent to
cget("value")). Set it withconfigure(value=...).
Styling options#
This section is for changing how the floodgauge looks. Define a style with
style.configure(...) (and style.map(...) for per-state colors), then
apply it with Floodgauge(bootstyle=...) or a custom style.
Bootstyle mapping#
Any of the accent colors – primary, secondary, success, info, warning, danger, light, dark – substitutes for primary below. neutral does not apply to this family.
A vertical widget resolves to the Vertical. twin of each style name above.
|
ttk style name |
|---|---|
|
|
Layout (elements)#
The widget is drawn from these nested parts. Each is an element you can target by name in a custom layout:
primary.Horizontal.Floodgauge.trough
primary.Horizontal.Floodgauge.pbar
Floodgauge.label
Configurable style options#
Options you can set with style.configure(...) / style.map(...):
anchor, arrowcolor, arrowsize, background, barsize, bordercolor, borderwidth, compound, darkcolor, embossed, font, foreground, gripcount, image, justify, lightcolor, orient, pbarrelief, sliderlength, space, stipple, text, thickness, troughcolor, underline, width, wraplength
Supported states#
This style declares no style.map(...) overrides; any state-dependent appearance is drawn from its image elements.
Hand-styling example#
import ttkbootstrap as ttk
app = ttk.App()
style = app.style
style.configure("my.Horizontal.TFloodgauge", background="#3498db", foreground="white")
# This style backs an internal/shipped widget rather than a
# directly-constructed ttk widget; configure the style class above.
See also#
Floodgauge catalog page — usage, screenshots, and examples.
Progressbar — the native ttk progress bar.