Skip to content

gh-151910: Add tkinter.ttk.Treeview methods for the Tk 9.1 enhanced treeview#151911

Open
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-treeview-9.1
Open

gh-151910: Add tkinter.ttk.Treeview methods for the Tk 9.1 enhanced treeview#151911
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-treeview-9.1

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 22, 2026

Copy link
Copy Markdown
Member

Wrap the enhanced ttk::treeview widget commands added in Tk 9.1 (TIP 740), and the detached query added in Tk 9.0, as :class:tkinter.ttk.Treeview methods.

Item navigation and queries: after_item, before_item, depth, haschildren, visible, size, range, identifier, current.

Opening, hiding, sorting and searching: expand, collapse, hide, unhide, sort, search, search_all, search_cell, search_all_cells.

Cell focus, selection and tagging: cellfocus, cellselection with the set/add/remove cell-list and *_range rectangle forms, cellselection_anchor/includes/present, and tag_cell_add/remove/has.

Detached query: detached, detached_all.

The new methods require Tk 9.1 (or 9.0 for detached). They were tested against a locally built Tcl/Tk 9.1; the new tests are gated with requires_tk and run on buildbots that have a recent enough Tk.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo

@read-the-docs-community

read-the-docs-community Bot commented Jun 22, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33245527 | 📁 Comparing 5eca821 against main (476b649)

  🔍 Preview build  

3 files changed
± library/tkinter.ttk.html
± whatsnew/3.16.html
± whatsnew/changelog.html

…nced treeview

Wrap the enhanced ttk::treeview widget commands added in Tk 9.1 (TIP 740),
and the detached query added in Tk 9.0, as tkinter.ttk.Treeview methods:
item navigation and queries (after_item, before_item, depth, haschildren,
visible, size, range, identifier, current), opening, hiding, sorting and
searching (expand, collapse, hide, unhide, sort, search, search_all,
search_cell, search_all_cells), cell focus, selection and tagging
(cellfocus, cellselection and its set/add/remove cell-list and *_range
rectangle forms, anchor/includes/present, tag_cell_add/remove/has), and the
detached query (detached, detached_all).

The expand() and collapse() methods, without recurse, also work on Tk older
than 9.1, where they are emulated via the item -open option.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo
detached_all() and the ancestor-aware detached() query require Tk 9.1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant