Skip to content

bpo-27115: Use Query subclass for IDLE editor Goto #18871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 9, 2020

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Mar 9, 2020

Replace tkinter tkSimpleDialog.askinteger with IDLE query dialog.
The new box checks for positivity before returning.

https://bugs.python.org/issue27115

"Get a positive line number for editor Go To Line."
# Used in editor.EditorWindow.goto_line_event.

def __init__(self, parent, title, message, *, _htest=False, _utest=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This __init__ seems unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I copied and edited from an existing subclass that does need it. Deleted.

text.bell()
return "break"

lineno = query.Goto(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this behave correctly when simply closing the dialog?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Cursor stays put but selection is erroneously cleared. Fixed.

@@ -3,6 +3,9 @@ Released on 2020-10-05?
======================================


bpo-27115: For Edit Go to Line, use a Query entry box subclass with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Edit Go to Line" is a bit awkward; IMO "Go to Line" is sufficient and clearer.

(Relevant to the NEWS entry as well.)

Copy link
Member Author

@terryjreedy terryjreedy Mar 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Thank you for the comments.

@terryjreedy terryjreedy merged commit 363fab8 into python:master Mar 9, 2020
@miss-islington
Copy link
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@terryjreedy terryjreedy deleted the gotobox branch March 9, 2020 20:51
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
@bedevere-bot
Copy link

GH-18886 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-18887 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington added a commit that referenced this pull request Mar 9, 2020
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab8)

Co-authored-by: Terry Jan Reedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants