Skip to content

gh-151881: Add tkinter Menu.postcascade, Misc.tk_scaling and tk_inactive - #151882

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:tkinter-postcascade-tk-utils
Jun 22, 2026
Merged

serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:tkinter-postcascade-tk-utils

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

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

  • Menu.postcascade(index) wraps the menu postcascade command (since Tk 8.5): it posts the submenu of the cascade entry given by index (unposting any previously posted submenu), complementing the existing :meth:!post and :meth:!unpost methods.
  • Misc.tk_scaling(number=None, displayof=0) wraps tk scaling (since Tk 8.4): it queries or sets the scaling factor in pixels per point used to convert between physical units and pixels.
  • Misc.tk_inactive(reset=False, displayof=0) wraps tk inactive (since Tk 8.5): it returns the user idle time in milliseconds (or -1 if unsupported), and can reset that timer.

All three commands are available on the bundled Tk, so no version guard is needed.

🤖 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 #33249879 | 📁 Comparing 6704ac3 against main (7782794)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

…_inactive

Wrap three long-standing Tk commands that had no tkinter wrapper:

* Menu.postcascade() posts the submenu of a cascade entry (Tk 8.5),
  complementing the existing post() and unpost() methods.
* Misc.tk_scaling() queries or sets the scaling factor in pixels per
  point used to convert between physical units and pixels (Tk 8.4).
* Misc.tk_inactive() returns the user idle time in milliseconds, and can
  reset that timer (Tk 8.5).

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-postcascade-tk-utils branch from 6295b19 to e55966b Compare June 21, 2026 23:27
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) June 22, 2026 11:50
@serhiy-storchaka
serhiy-storchaka merged commit 6185dfb into python:main Jun 22, 2026
47 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the tkinter-postcascade-tk-utils branch June 22, 2026 13:56
pyctrl pushed a commit to pyctrl/cpython that referenced this pull request Jul 5, 2026
…_inactive (pythonGH-151882)

Wrap three long-standing Tk commands that had no tkinter wrapper:

* Menu.postcascade() posts the submenu of a cascade entry (Tk 8.5),
  complementing the existing post() and unpost() methods.
* Misc.tk_scaling() queries or sets the scaling factor in pixels per
  point used to convert between physical units and pixels (Tk 8.4).
* Misc.tk_inactive() returns the user idle time in milliseconds, and can
  reset that timer (Tk 8.5).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant