Skip to content

Commit 34d8ed4

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-76607: Improve documentation of the tkinter cursor option (GH-152481) (GH-153111)
Link to the cursors(3tk) manual page for the available cursor names and note that they are platform-dependent. (cherry picked from commit ea57037) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ea59b95 commit 34d8ed4

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

Doc/library/tkinter.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ Here are some examples of typical usage::
739739
myapp.mainloop()
740740

741741

742+
.. _Tk-option-data-types:
743+
742744
Tk option data types
743745
^^^^^^^^^^^^^^^^^^^^
744746

@@ -772,12 +774,16 @@ color
772774
represent any legal hex digit. See page 160 of Ousterhout's book for details.
773775

774776
cursor
775-
The standard X cursor names from :file:`cursorfont.h` can be used, without the
776-
``XC_`` prefix. For example to get a hand cursor (``XC_hand2``), use the
777-
string ``"hand2"``. You can also specify a bitmap and mask file of your own.
777+
The name of the mouse cursor to display while the pointer is over the widget.
778+
Tk provides a portable set of cursor names available on all platforms
779+
(for example ``"arrow"``, ``"watch"``, ``"cross"``, or ``"hand2"``);
780+
the standard X cursor names from :file:`cursorfont.h` may also be used,
781+
without the ``XC_`` prefix (so ``XC_hand2`` becomes ``"hand2"``).
782+
The full list of names, including the platform-specific ones,
783+
is given in the :manpage:`cursors(3tk)` manual page.
784+
You can also specify a bitmap and mask file of your own.
778785
On Windows a cursor file (:file:`.cur` or :file:`.ani`) may be used directly,
779786
giving its path preceded with an ``@``, as in ``"@C:/cursors/bart.ani"``.
780-
See page 179 of Ousterhout's book.
781787

782788
distance
783789
Screen distances can be specified in either pixels or absolute distances.

Doc/library/tkinter.ttk.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ All the :mod:`!ttk` Widgets accept the following options:
118118
| | read-only, and may only be specified when the window is |
119119
| | created. |
120120
+-----------+--------------------------------------------------------------+
121-
| cursor | Specifies the mouse cursor to be used for the widget. If set |
122-
| | to the empty string (the default), the cursor is inherited |
123-
| | from the parent widget. |
121+
| cursor | Specifies the mouse cursor to be used for the widget. See |
122+
| | the *cursor* option type under :ref:`Tk-option-data-types`. |
123+
| | If set to the empty string (the default), the cursor is |
124+
| | inherited from the parent widget. |
124125
+-----------+--------------------------------------------------------------+
125126
| takefocus | Determines whether the window accepts the focus during |
126127
| | keyboard traversal. 0, 1 or an empty string is returned. |

0 commit comments

Comments
 (0)