Cursors#
Every widget takes a cursor option that sets the mouse pointer shown while it
is over the widget. Pass one of the names below; an empty string resets it so the
widget inherits its parent’s cursor.
entry = ttk.Entry(app, cursor="xterm") # text I-beam over this entry
app.configure(cursor="watch") # busy pointer over the whole window
app.configure(cursor="") # back to the default
Note
The names come from Tk’s cursor command, whose reference lives in a
C-oriented Tk manual page. A cursor’s appearance
is platform-dependent — the same name can look different on Windows, macOS,
and Linux, and several names map to the same system pointer. For a busy
pointer over a whole window, prefer the busy helper — see
Mark a window busy.
Common cursors#
The pointers you will actually reach for, and what each conventionally means.
Name |
Meaning / typical use |
|---|---|
arrowleft_ptr |
The default pointer. |
|
Text I-beam — over editable text. |
|
Pointing hand — a clickable link or hotspot. |
|
Open hand — a draggable / grabbable area. |
|
Four-way move arrows — drag to reposition. |
|
Busy / working (an |
crosshairtcross |
Precise selection or drawing. |
|
Resize from a corner. |
|
Horizontal resize (↔) — a vertical split or column edge. |
|
Vertical resize (↕) — a horizontal split or row edge. |
|
Context help. |
|
Add, or cell selection. |
|
Draw or edit. |
|
Action not allowed. |
|
Delete / kill (a skull-and-crossbones). |
dotboxtargetdot |
Miscellaneous marking pointers. |
Setting a cursor while busy#
A common use is showing a wait pointer during a slow operation, then restoring it. Force the pointer to update before the work starts:
app.configure(cursor="watch")
app.update_idletasks() # show the cursor before blocking
do_slow_work()
app.configure(cursor="") # restore
See Mark a window busy for the busy
helper, which does this for a whole window (and disables input) in one call.
All portable names#
These names come from the X11 cursor font and are accepted on all platforms.
Many are legacy or decorative shapes (gumby, coffee_mug, spraycan)
that map to a generic pointer outside X11 — the common set above is what renders
distinctly everywhere.
|
|
|
|
Platform-specific names#
Windows and macOS add native pointers on top of the portable set. Windows provides:
|
|
|
|
macOS adds its own native cursors (copy, alias, contextual-menu, and resize variants, among others). Because these are not portable, see the Tk cursor manual page for the exact platform lists.
Warning
Tk on Windows accepts any of these names without error, but a name outside what the platform supports falls back to a generic pointer rather than raising — so an unsupported cursor fails silently. Stick to the common set for a consistent result across platforms.