Skip to content

gh-151878: Add tkinter Entry and Spinbox validate methods#151879

Merged
serhiy-storchaka merged 4 commits into
python:mainfrom
serhiy-storchaka:tkinter-entry-validate
Jun 22, 2026
Merged

gh-151878: Add tkinter Entry and Spinbox validate methods#151879
serhiy-storchaka merged 4 commits into
python:mainfrom
serhiy-storchaka:tkinter-entry-validate

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

Wrap the Tk validate widget command of the entry and spinbox widgets, which previously had no tkinter wrapper and was reachable only through tk.call().

Entry.validate() and Spinbox.validate() force an evaluation of the command given by the validatecommand option, independently of the conditions specified by the validate option (by temporarily setting validate to all), and return whether the value is considered valid.

The command is available since Tk 8.5, so no version guard is needed. The shared test in EntryTest is inherited by SpinboxTest, covering both widgets.

🤖 Generated with Claude Code

Wrap the Tk "validate" widget command of the entry and spinbox widgets as
the methods Entry.validate() and Spinbox.validate(), forcing an evaluation
of the validatecommand independently of the validate option and returning
whether the value is valid.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo
@read-the-docs-community

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33248294 | 📁 Comparing ca736fc against main (30aeeb3)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 22, 2026 11:35
@serhiy-storchaka serhiy-storchaka merged commit c42f36a into python:main Jun 22, 2026
50 of 51 checks passed
@serhiy-storchaka serhiy-storchaka deleted the tkinter-entry-validate branch June 22, 2026 13:18
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