gh-71808: Rebuild IDLE query dialogs on tkinter.simpledialog.Dialog#152773
Open
serhiy-storchaka wants to merge 1 commit into
Open
gh-71808: Rebuild IDLE query dialogs on tkinter.simpledialog.Dialog#152773serhiy-storchaka wants to merge 1 commit into
serhiy-storchaka wants to merge 1 commit into
Conversation
…alog Subclass Dialog instead of reimplementing its modal machinery. The query dialogs gain its keyboard equivalents -- <Return>, <Escape>, and Alt-underlined-letter button accelerators (pythongh-71807).
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.
idlelib.query.Queryhand-rolled the modal-dialog machinery (transient window, grab,wait_window, OK/Cancel buttons, geometry) thattkinter.simpledialog.Dialognow provides. This rebuildsQueryas aDialogsubclass:create_widgets()becomesbody(), and the buttons are dropped in favor of Dialog's standardbuttonbox(). The query dialogs (Open Module, custom Run, new config-section / highlight-theme / key-set names, Help source) therefore gain Dialog's keyboard equivalents —<Return>,<Escape>, andAlt+underlined-letter button accelerators — and its default-button handling (IDLE: Add keyboard equivalents for mouse actions. #71807).ok()'s validation moves tovalidate();ok/cancel/transient/grab/wait_windoware inherited.entry_okvalidation API and all five subclasses are preserved, as are IDLE's<KP_Enter>and macOS<Command-.>bindings and the non-resizable geometry.tkinter.simpledialog(ttk widgets,2mpaddings,stickyfills).A private
Dialog._show_modal()seam is added soQuerycan suppress the modal wait when unit testing; it is a behavior-preserving refactor of the tail ofDialog.__init__.Main-only: it depends on the themed (
use_ttk)Dialog, which is not in the maintenance branches.