Skip to content

Commit a9c15c6

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-153550: Modernize the older prose sections of the tkinter documentation (GH-153647) (GH-153774)
Refresh the narrative "Tkinter life preserver" and "Handy reference" sections to match the overhauled reference (gh-86726 and gh-153549). * Rework "The packer" into a general "Geometry management" section covering grid, pack and place, and cross-link it with the Grid, Pack and Place reference classes. * Rework "The window manager" and "Coupling widget variables", replacing the dated App(Frame) examples with direct Tk() and ttk examples. * Replace page-number citations to Ousterhout's book with links to the relevant Tk man pages. * Modernize the tkinter.ttk front matter and its Tcl/Tk links, and add cross-references between the two documents. * Reconcile the "Packer options" and "Tk option data types" lists with the reference, and fill in the empty Entry index list. * Fix the malformed target-selection list in tkinter.dnd. (cherry picked from commit 93beea7) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent aee474f commit a9c15c6

3 files changed

Lines changed: 225 additions & 157 deletions

File tree

Doc/library/tkinter.dnd.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,22 @@ a single application, within the same window or between windows. To enable an
1616
object to be dragged, you must create an event binding for it that starts the
1717
drag-and-drop process. Typically, you bind a ButtonPress event to a callback
1818
function that you write (see :ref:`Bindings-and-Events`). The function should
19-
call :func:`dnd_start`, where 'source' is the object to be dragged, and 'event'
19+
call :func:`dnd_start`, where *source* is the object to be dragged, and *event*
2020
is the event that invoked the call (the argument to your callback function).
2121

2222
Selection of a target object occurs as follows:
2323

24-
#. Top-down search of area under mouse for target widget
24+
#. Top-down search of the area under the mouse for a target widget:
2525

26-
* Target widget should have a callable *dnd_accept* attribute
27-
* If *dnd_accept* is not present or returns ``None``, search moves to parent widget
28-
* If no target widget is found, then the target object is ``None``
26+
* the target widget should have a callable *dnd_accept* attribute;
27+
* if *dnd_accept* is not present or returns ``None``,
28+
the search moves to the parent widget;
29+
* if no target widget is found, the target object is ``None``.
2930

30-
2. Call to *<old_target>.dnd_leave(source, event)*
31-
#. Call to *<new_target>.dnd_enter(source, event)*
32-
#. Call to *<target>.dnd_commit(source, event)* to notify of drop
33-
#. Call to *<source>.dnd_end(target, event)* to signal end of drag-and-drop
31+
#. Call to ``<old_target>.dnd_leave(source, event)``.
32+
#. Call to ``<new_target>.dnd_enter(source, event)``.
33+
#. Call to ``<target>.dnd_commit(source, event)`` to notify of the drop.
34+
#. Call to ``<source>.dnd_end(target, event)`` to signal the end of drag-and-drop.
3435

3536

3637
.. class:: DndHandler(source, event)

0 commit comments

Comments
 (0)