Busy#
Tk can cover a widget with a transparent window that swallows pointer events and
shows a busy cursor, so a slow operation can’t be clicked into. These methods
hold and release that state. For the worked recipe — including the update
call that makes it visible, and the try/finally that always releases it —
see Mark a window busy.
The canonical upstream reference is the Tcl tk busy manual page (Tk 8.6).
Note
Not supported on macOS. The calls succeed and busy_status() reports
True, but nothing is drawn and nothing is blocked.
The busy command is Tk 8.6, so it is available on every Python ttkbootstrap supports. tkinter itself only grew these methods in 3.13; on 3.10–3.12 ttkbootstrap supplies them, issuing the same Tk command underneath.
Each method also has a longer tk_busy_* spelling — busy_hold is
tk_busy_hold, busy_forget is tk_busy_forget, and so on. They are the
same calls; the short names are used here.
- busy(**kw)
Make this widget appear busy: block pointer events to it and everything inside it, and show a busy cursor. Aliases:
busy_hold,tk_busy,tk_busy_hold.Call
updateimmediately afterward — the overlay is only mapped once the event loop runs, so without it nothing appears before your blocking work starts.Pointer events only: a widget that already had keyboard focus keeps receiving keystrokes.
- Parameters:
cursor – the cursor to show while busy (e.g.
"watch"). The only supported option.- Returns:
None.
- busy_forget()
Release the busy state; the widget receives user events again. Alias:
tk_busy_forget.- Returns:
None.
- busy_status()
Whether this widget is currently held busy. Alias:
tk_busy_status.- Returns:
Truewhile held,Falseotherwise.- Return type:
- busy_current(pattern=None)
The widgets currently held busy. Alias:
tk_busy_current.- Parameters:
pattern – an optional glob matched against widget path names.
- Returns:
the matching busy widget objects.
- Return type:
- busy_cget(option)
Read one busy configuration option. The widget must already be held busy. Alias:
tk_busy_cget.- Parameters:
option (str) – the option name, e.g.
"cursor".- Returns:
the option’s current value.
- busy_configure(cnf=None, **kw)
Query or change the busy options while held. Aliases:
busy_config,tk_busy_config,tk_busy_configure.- Parameters:
cnf – an optional dict of options (merged with
kw).kw – option/value pairs to set.
- Returns:
with no arguments, a dict mapping each option to its spec
(name, dbName, dbClass, default, current); otherwiseNone.
See also
Mark a window busy — the recipe, and what to do on macOS instead.
Cursors — the names
cursoraccepts.