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.
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
ENH: add ScientificDoubleSpinBox and use it in MultiModeValueEdit #208
ENH: add ScientificDoubleSpinBox and use it in MultiModeValueEdit #208
Changes from 4 commits
ead1ae4
36f29df
6d5a424
6d37e03
e9a1db0
2fe98b7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing
array[x-1]
with no bounds check concerns me a bit...Have an explanation as to how
validate()
gets called withstring
andposition
to help me understand why such a check isn't necessary?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate is a method of entry widgets,
string
is the string in the widget, andposition
is the cursor position in that string. This clause is what lets you type out "2e" or "2." and not have the validator block your inputs.position
will be inrange(len(string))
.A closer look at this reveals weird ways to break this logic. I'll try to touch it up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic branch isn't necessarily perfect, but in cases where you type an invalid float (say: "2.3ee", where the validator still reports "intermediate"), the spinbox will revert the change if you hit enter/shift focus. I actually think this is ok as is, since the
fixup
method will repair broken entries.