mirror of
https://github.com/python/cpython.git
synced 2025-10-05 22:51:56 +00:00
bpo-32585: Add tkinter.ttk.Spinbox. (GH-5221) (GH-5592)
(cherry picked from commit a48e78a0b7
)
Co-authored-by: Alan D Moore <me@alandmoore.com>
This commit is contained in:
parent
ad3997c592
commit
105fcbfd6a
6 changed files with 300 additions and 7 deletions
|
@ -19,7 +19,7 @@ __author__ = "Guilherme Polo <ggpolo@gmail.com>"
|
|||
__all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label",
|
||||
"Labelframe", "LabelFrame", "Menubutton", "Notebook", "Panedwindow",
|
||||
"PanedWindow", "Progressbar", "Radiobutton", "Scale", "Scrollbar",
|
||||
"Separator", "Sizegrip", "Style", "Treeview",
|
||||
"Separator", "Sizegrip", "Spinbox", "Style", "Treeview",
|
||||
# Extensions
|
||||
"LabeledScale", "OptionMenu",
|
||||
# functions
|
||||
|
@ -1151,6 +1151,33 @@ class Sizegrip(Widget):
|
|||
Widget.__init__(self, master, "ttk::sizegrip", kw)
|
||||
|
||||
|
||||
class Spinbox(Entry):
|
||||
"""Ttk Spinbox is an Entry with increment and decrement arrows
|
||||
|
||||
It is commonly used for number entry or to select from a list of
|
||||
string values.
|
||||
"""
|
||||
|
||||
def __init__(self, master=None, **kw):
|
||||
"""Construct a Ttk Spinbox widget with the parent master.
|
||||
|
||||
STANDARD OPTIONS
|
||||
|
||||
class, cursor, style, takefocus, validate,
|
||||
validatecommand, xscrollcommand, invalidcommand
|
||||
|
||||
WIDGET-SPECIFIC OPTIONS
|
||||
|
||||
to, from_, increment, values, wrap, format, command
|
||||
"""
|
||||
Entry.__init__(self, master, "ttk::spinbox", **kw)
|
||||
|
||||
|
||||
def set(self, value):
|
||||
"""Sets the value of the Spinbox to value."""
|
||||
self.tk.call(self._w, "set", value)
|
||||
|
||||
|
||||
class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
"""Ttk Treeview widget displays a hierarchical collection of items.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue