gh-151874: Add tkinter wm_stackorder, wm_iconbadge and winfo_isdark#151875
Merged
serhiy-storchaka merged 2 commits intoJun 22, 2026
Conversation
Documentation build overview
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
6f52390 to
c9d71ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wrap three Tk window-management commands that previously had no tkinter wrapper and were reachable only through
tk.call().Wm.wm_stackorder()(and thestackorderalias) wrapswm stackorder(since Tk 8.4): with no arguments it returns the mapped toplevel widgets in stacking order from lowest to highest; withisabove/isbelowand another toplevel it returns whether this window is above or below it.Wm.wm_iconbadge()(and theiconbadgealias) wrapswm iconbadge(new in Tk 9.0), which sets a badge (a number or an exclamation point) on the application icon.Misc.winfo_isdark()wrapswinfo isdark(new in Tk 9.0), which reports whether a window is in dark mode on macOS and Windows.wm_stackorderreturns widget objects via_nametowidgetfor consistency withwm_colormapwindows.The Tk 9.0 methods are covered by tests gated on
@requires_tk(9, 0);wm_stackorderis tested on Tk 8.6 as well.🤖 Generated with Claude Code