Python‎ > ‎tkinter‎ > ‎

tkinter.Spinbox


Definition
Construct a spinbox widget with the parent MASTER.

Syntax
__init__(self, master=None, cnf={}, **kw)
Spinbox()
tkinter.Spinbox()

Options
Spinbox(activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, justify, relief, repeatdelay, repeatinterval, selectbackground, selectborderwidth, selectforeground, takefocus, textvariable, xscrollcommand.)

Widget Specific options
buttonbackground, buttoncursor, buttondownrelief, buttonuprelief, command, disabledbackground,
disabledforeground, format, from, invalidcommand, increment, readonlybackground, state, to,
validate, validatecommand values, width, wrap.

Examples
The day of birth values are added in Spinbox.
from tkinter import*

master=Tk()
master.title("Day of Birth")

spinbox_day=Spinbox(master,fg="blue", font=12, from_=0, to=31)
spinbox_day.pack(side=LEFT)

spinbox_month=Spinbox(master, fg="blue", font=12, values=("Jan","Feb",
                                       "Mar", "Apr","May","Jun","Jul","Aug",
                                      "Sep", "Oct", "Nov","Dec"))
spinbox_month.pack(side=LEFT)

spinbox_year=Spinbox(master, fg="blue", font=12, from_=1900, to=2015)
spinbox_year.pack(side=LEFT)

master.mainloop()








tkinter


Comments