Commit 794689b
gh-153550: Modernize the older prose sections of the tkinter documentation
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 that
covers grid, pack and place, with a short example and use case for
each, presents grid as the flexible default, and warns against mixing
pack and grid in one container. Add symmetric cross-links between the
Grid, Pack and Place reference classes and this section.
* Rework "The window manager": explain what the window manager is, state
that the Wm mixin is inherited by Tk and Toplevel so its methods are
called directly on a top-level window, and replace the dated
App(Frame) example (which reached the window through master) with a
direct Tk() example. Drop the private _root() aside and cross-link
the section and the Wm reference class to each other.
* Rework "Coupling widget variables": explain that a widget links to a
Variable object rather than a plain Python variable because Python
cannot notify Tk when a variable is reassigned, and replace the dated
App(Frame) example (whose entry was attached to the wrong parent) with
a direct ttk example showing both get() and set().
* Remove the page-number citations to Ousterhout's book and point to the
relevant Tk man pages instead.
* Refresh the Tcl/Tk links in tkinter.ttk: add the official ttk::intro
man page as the current explanation of the theme engine, keep Joe
English's illustrated 2004 "Tile Widget Set" paper for its element and
layout diagrams, and drop the now-redundant conversion monograph.
* Modernize the tkinter.ttk front matter: lead the introduction with the
native-theme benefit instead of peripheral features, update the TIP 48
link to its canonical URL, and add a note recommending the explicit
"from tkinter import ttk" form over the star-import override.
* Add cross-references between the two documents: point the tkinter.ttk
introduction at the shared concepts documented for tkinter, and link
the themed-widgets note in the tkinter introduction to tkinter.ttk.
* Reconcile the "Packer options" and "Tk option data types" lists with
the reference: replace the incomplete packer list with a cross-link to
Pack.pack_configure, and frame the data-types list as the shared value
types the reference refers to.
* Fill in the empty Entry index list under "The index parameter", and
describe "@6" as a string rather than an integer.
* Point the classic base-widget examples at the themed ttk widgets.
* Fix the malformed target-selection list in tkinter.dnd: make it a
single ordered list with the sub-steps nested under the search step,
and mark up "source" and "event" as parameters.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dd2faeb commit 794689b
3 files changed
Lines changed: 221 additions & 157 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
0 commit comments