mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
bpo-32585: Add tkinter.ttk.Spinbox. (#5221)
This commit is contained in:
parent
32921f9082
commit
a48e78a0b7
6 changed files with 300 additions and 7 deletions
|
@ -19,7 +19,7 @@
|
|||
__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
|
||||
|
@ -1149,6 +1149,33 @@ def __init__(self, master=None, **kw):
|
|||
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