Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1deea5e5
Commit
1deea5e5
authored
Oct 18, 2018
by
Juliette Monsel
Committed by
Serhiy Storchaka
Oct 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760)
parent
bbd90e4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
Lib/tkinter/__init__.py
Lib/tkinter/__init__.py
+4
-4
Lib/tkinter/test/test_tkinter/test_widgets.py
Lib/tkinter/test/test_tkinter/test_widgets.py
+8
-1
Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst
...S.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst
+2
-0
No files found.
Lib/tkinter/__init__.py
View file @
1deea5e5
...
...
@@ -4280,7 +4280,7 @@ class Spinbox(Widget, XView):
select to commands. If the selection isn't currently in
the spinbox, then a new selection is created to include
the characters between index and the most recent selection
anchor point, inclusive.
Returns an empty string.
anchor point, inclusive.
"""
return
self
.
selection
(
"adjust"
,
index
)
...
...
@@ -4288,7 +4288,7 @@ class Spinbox(Widget, XView):
"""Clear the selection
If the selection isn't in this widget then the
command has no effect.
Returns an empty string.
command has no effect.
"""
return
self
.
selection
(
"clear"
)
...
...
@@ -4296,9 +4296,9 @@ class Spinbox(Widget, XView):
"""Sets or gets the currently selected element.
If a spinbutton element is specified, it will be
displayed depressed
displayed depressed
.
"""
return
self
.
selection
(
"element"
,
element
)
return
self
.
tk
.
call
(
self
.
_w
,
'selection'
,
'element'
,
element
)
def
selection_from
(
self
,
index
):
"""Set the fixed end of a selection to INDEX."""
...
...
Lib/tkinter/test/test_tkinter/test_widgets.py
View file @
1deea5e5
...
...
@@ -522,7 +522,14 @@ class SpinboxTest(EntryTest, unittest.TestCase):
self
.
assertEqual
(
widget
.
selection_get
(),
'2345'
)
widget
.
selection_adjust
(
0
)
self
.
assertEqual
(
widget
.
selection_get
(),
'12345'
)
widget
.
selection_adjust
(
0
)
def
test_selection_element
(
self
):
widget
=
self
.
create
()
self
.
assertEqual
(
widget
.
selection_element
(),
"none"
)
widget
.
selection_element
(
"buttonup"
)
self
.
assertEqual
(
widget
.
selection_element
(),
"buttonup"
)
widget
.
selection_element
(
"buttondown"
)
self
.
assertEqual
(
widget
.
selection_element
(),
"buttondown"
)
@
add_standard_options
(
StandardOptionsTests
)
...
...
Misc/NEWS.d/next/Library/2018-10-08-21-05-11.bpo-34936.3tRqdq.rst
0 → 100644
View file @
1deea5e5
Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``. Patch by
Juliette Monsel.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment