mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-34829: Add missing selection_ methods to the Tkinter Spinbox. (GH-9617)
Implement the methods selection_from(), selection_range(), selection_present() and selection_to() for Tkinter Spinbox.
This commit is contained in:
parent
a8d5e2f255
commit
af5658ae93
5 changed files with 82 additions and 0 deletions
|
@ -3770,6 +3770,24 @@ class Spinbox(Widget, XView):
|
|||
"""
|
||||
return self.selection("element", element)
|
||||
|
||||
def selection_from(self, index):
|
||||
"""Set the fixed end of a selection to INDEX."""
|
||||
self.selection('from', index)
|
||||
|
||||
def selection_present(self):
|
||||
"""Return True if there are characters selected in the spinbox, False
|
||||
otherwise."""
|
||||
return self.tk.getboolean(
|
||||
self.tk.call(self._w, 'selection', 'present'))
|
||||
|
||||
def selection_range(self, start, end):
|
||||
"""Set the selection from START to END (not included)."""
|
||||
self.selection('range', start, end)
|
||||
|
||||
def selection_to(self, index):
|
||||
"""Set the variable end of a selection to INDEX."""
|
||||
self.selection('to', index)
|
||||
|
||||
###########################################################################
|
||||
|
||||
class LabelFrame(Widget):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue