Skip to content

gh-153550: Modernize the older prose sections of the tkinter documentation#153647

Open
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:gh-153550-modernize-tkinter-prose
Open

gh-153550: Modernize the older prose sections of the tkinter documentation#153647
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:gh-153550-modernize-tkinter-prose

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Follow-up of gh-86726, closing gh-153550.

The tkinter reference sections were overhauled in gh-86726 and #153549, but the narrative prose preceding them — Tkinter life preserver and Handy reference in Doc/library/tkinter.rst, plus the tkinter.ttk front matter — still read like a late-1990s tutorial. This is an editorial pass to match. No API changes.

tkinter.rst

  • Replace The packer with a general Geometry management section covering grid, pack and place, with an example and use case for each, grid as the default, and a warning against mixing pack and grid in one container.
  • Rework The window manager and Coupling widget variables: modern Tk()/ttk examples instead of the dated App(Frame) idiom, and correct explanations (e.g. a widget links to a Variable because Python can't notify Tk when a plain variable is reassigned).
  • Drop the Ousterhout page-number citations for the relevant Tk man pages; reconcile the Packer options and Tk option data types lists with the reference; fill in the empty Entry-index list; point classic examples at the ttk widgets.

tkinter.ttk.rst

  • Lead the intro with the native-theme benefit; fix the TIP 48 link; recommend the explicit from tkinter import ttk form; refresh the theme-engine links (ttk::intro + the illustrated Tile Widget Set paper); add cross-references to tkinter.rst.

tkinter.dnd.rst

  • Fix the malformed target-selection list and mark up source/event as parameters.

Docs-only; no Misc/NEWS.d entry.

…cumentation

Refresh the narrative "Tkinter life preserver" and "Handy reference"
sections to match the overhauled reference (pythongh-86726 and pythongh-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>
@read-the-docs-community

read-the-docs-community Bot commented Jul 13, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33559847 | 📁 Comparing 94ac6b6 against main (adebb68)

  🔍 Preview build  

4 files changed
± library/tk.html
± library/tkinter.dnd.html
± library/tkinter.html
± library/tkinter.ttk.html

@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review July 13, 2026 07:46
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 13, 2026
Renaming the "The packer" section to "Geometry management" and folding
away the "Packer options" subsection removed their implicit HTML ids,
breaking existing deep links.  Restore both as explicit targets on the
new section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant