Tk uses a list font name format, such as {courier 10 bold}.
The example provided does not function, as it is using improper syntax (Note the curly brackets). The section should be corrected to reflect expected usage. This is the definition provided in typeshed/stdlib/tkinter/font.pyi : L15:
_FontDescription: TypeAlias= (
str# "Helvetica 12"|Font# A font object constructed in Python|list[Any] # ("Helvetica", 12, BOLD)|tuple[Any, ...]
|_tkinter.Tcl_Obj# A font object constructed in Tcl
)
Cursor:
You can also specify a bitmap and mask file of your own. See page 179 of Ousterhout’s book.
I recommend prepending the following sentence, as it is far more practical (in most situations) than the bitmap & mask method referenced.
To specify a cursor file (.cur or .ani), use the path to the file, preceded with an @, as in cursor="@path/to/cursor.cur"..
Thanks. The anchor and font items were already addressed by the documentation overhaul (gh-86726): the anchor entry now lists "n"…"nw" and "center", and font no longer presents {courier 10 bold} as Python — it shows the tuple/string forms. PR #152380 adds the remaining piece, the Windows @C:/cursors/bart.ani cursor-file form.
Activity
serhiy-storchaka commented on Jun 27, 2026
Thanks. The anchor and font items were already addressed by the documentation overhaul (gh-86726): the anchor entry now lists "n"…"nw" and "center", and font no longer presents {courier 10 bold} as Python — it shows the tuple/string forms. PR #152380 adds the remaining piece, the Windows @C:/cursors/bart.ani cursor-file form.
gh-82830: Improve tkinter messagebox docstrings and cursor documentat…
[3.13] gh-82830: Improve tkinter messagebox docstrings and cursor doc…
[3.14] gh-82830: Improve tkinter messagebox docstrings and cursor doc…
[3.15] gh-82830: Improve tkinter messagebox docstrings and cursor doc…