@@ -66,13 +66,13 @@ for improved styling effects.
6666Ttk Widgets
6767-----------
6868
69- Ttk comes with 17 widgets, eleven of which already existed in tkinter:
69+ Ttk comes with 18 widgets, twelve of which already existed in tkinter:
7070:class: `Button `, :class: `Checkbutton `, :class: `Entry `, :class: `Frame `,
7171:class: `Label `, :class: `LabelFrame `, :class: `Menubutton `, :class: `PanedWindow `,
72- :class: `Radiobutton `, :class: `Scale ` and :class: `Scrollbar `. The other six are
73- new: :class: `Combobox `, :class: `Notebook `, :class: ` Progressbar `,
74- :class: `Separator `, :class: `Sizegrip ` and :class: `Treeview `. And all them are
75- subclasses of :class: `Widget `.
72+ :class: `Radiobutton `, :class: `Scale `, :class: `Scrollbar `, and :class: ` Spinbox `.
73+ The other six are new: :class: `Combobox `, :class: `Notebook `,
74+ :class: `Progressbar `, :class: `Separator `, :class: `Sizegrip ` and
75+ :class: ` Treeview `. And all them are subclasses of :class: `Widget `.
7676
7777Using the Ttk widgets gives the application an improved look and feel.
7878As discussed above, there are differences in how the styling is coded.
@@ -381,6 +381,87 @@ ttk.Combobox
381381 Sets the value of the combobox to *value *.
382382
383383
384+ Spinbox
385+ -------
386+ The :class: `ttk.Spinbox ` widget is a :class: `ttk.Entry ` enhanced with increment
387+ and decrement arrows. It can be used for numbers or lists of string values.
388+ This widget is a subclass of :class: `Entry `.
389+
390+ Besides the methods inherited from :class: `Widget `: :meth: `Widget.cget `,
391+ :meth: `Widget.configure `, :meth: `Widget.identify `, :meth: `Widget.instate `
392+ and :meth: `Widget.state `, and the following inherited from :class: `Entry `:
393+ :meth: `Entry.bbox `, :meth: `Entry.delete `, :meth: `Entry.icursor `,
394+ :meth: `Entry.index `, :meth: `Entry.insert `, :meth: `Entry.xview `,
395+ it has some other methods, described at :class: `ttk.Spinbox `.
396+
397+ Options
398+ ^^^^^^^
399+
400+ This widget accepts the following specific options:
401+
402+ .. tabularcolumns :: |l|L|
403+
404+ +----------------------+------------------------------------------------------+
405+ | Option | Description |
406+ +======================+======================================================+
407+ | from | Float value. If set, this is the minimum value to |
408+ | | which the decrement button will decrement. Must be |
409+ | | spelled as ``from_ `` when used as an argument, since |
410+ | | ``from `` is a Python keyword. |
411+ +----------------------+------------------------------------------------------+
412+ | to | Float value. If set, this is the maximum value to |
413+ | | which the increment button will increment. |
414+ +----------------------+------------------------------------------------------+
415+ | increment | Float value. Specifies the amount which the |
416+ | | increment/decrement buttons change the |
417+ | | value. Defaults to 1.0. |
418+ +----------------------+------------------------------------------------------+
419+ | values | Sequence of string or float values. If specified, |
420+ | | the increment/decrement buttons will cycle through |
421+ | | the items in this sequence rather than incrementing |
422+ | | or decrementing numbers. |
423+ | | |
424+ +----------------------+------------------------------------------------------+
425+ | wrap | Boolean value. If ``True ``, increment and decrement |
426+ | | buttons will cycle from the ``to `` value to the |
427+ | | ``from `` value or the ``from `` value to the ``to `` |
428+ | | value, respectively. |
429+ +----------------------+------------------------------------------------------+
430+ | format | String value. This specifies the format of numbers |
431+ | | set by the increment/decrement buttons. It must be |
432+ | | in the form "%W.Pf", where W is the padded width of |
433+ | | the value, P is the precision, and '%' and 'f' are |
434+ | | literal. |
435+ +----------------------+------------------------------------------------------+
436+ | command | Python callable. Will be called with no arguments |
437+ | | whenever either of the increment or decrement buttons|
438+ | | are pressed. |
439+ | | |
440+ +----------------------+------------------------------------------------------+
441+
442+
443+ Virtual events
444+ ^^^^^^^^^^^^^^
445+
446+ The spinbox widget generates an **<<Increment>> ** virtual event when the
447+ user presses <Up>, and a **<<Decrement>> ** virtual event when the user
448+ presses <Down>.
449+
450+ ttk.Spinbox
451+ ^^^^^^^^^^^^
452+
453+ .. class :: Spinbox
454+
455+ .. method :: get()
456+
457+ Returns the current value of the spinbox.
458+
459+
460+ .. method :: set(value)
461+
462+ Sets the value of the spinbox to *value *.
463+
464+
384465Notebook
385466--------
386467
0 commit comments