Skip to content

gh-151874: Add tkinter wm_stackorder, wm_iconbadge and winfo_isdark#151875

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-wm-winfo-wrappers
Jun 22, 2026
Merged

gh-151874: Add tkinter wm_stackorder, wm_iconbadge and winfo_isdark#151875
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-wm-winfo-wrappers

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

Wrap three Tk window-management commands that previously had no tkinter wrapper and were reachable only through tk.call().

  • Wm.wm_stackorder() (and the stackorder alias) wraps wm stackorder (since Tk 8.4): with no arguments it returns the mapped toplevel widgets in stacking order from lowest to highest; with isabove/isbelow and another toplevel it returns whether this window is above or below it.
  • Wm.wm_iconbadge() (and the iconbadge alias) wraps wm iconbadge (new in Tk 9.0), which sets a badge (a number or an exclamation point) on the application icon.
  • Misc.winfo_isdark() wraps winfo isdark (new in Tk 9.0), which reports whether a window is in dark mode on macOS and Windows.

wm_stackorder returns widget objects via _nametowidget for consistency with wm_colormapwindows.

The Tk 9.0 methods are covered by tests gated on @requires_tk(9, 0); wm_stackorder is tested on Tk 8.6 as well.

🤖 Generated with Claude Code

@read-the-docs-community

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33248119 | 📁 Comparing 503962e against main (30aeeb3)

  🔍 Preview build  

4 files changed
± deprecations/index.html
± library/tkinter.html
± whatsnew/3.16.html
± whatsnew/changelog.html

…dark

Wrap the Tk commands "wm stackorder" (toplevel stacking order, since
Tk 8.4), "wm iconbadge" (application icon badge, new in Tk 9.0) and
"winfo isdark" (dark mode detection, new in Tk 9.0) as the methods
Wm.wm_stackorder(), Wm.wm_iconbadge() and Misc.winfo_isdark(), with the
usual stackorder and iconbadge short aliases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo
@serhiy-storchaka serhiy-storchaka force-pushed the tkinter-wm-winfo-wrappers branch from 6f52390 to c9d71ca Compare June 21, 2026 22:22
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 22, 2026 11:31
@serhiy-storchaka serhiy-storchaka merged commit 851b779 into python:main Jun 22, 2026
51 checks passed
@serhiy-storchaka serhiy-storchaka deleted the tkinter-wm-winfo-wrappers branch June 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant