tkinter.Spinbox.pack


Definition
Create the Spinbox in the widget.

Syntax
tkinter.Spinbox.pack()
Spinbox.pack.

Options
  • Spinbox.pack(
  • after=widget - pack it after you have packed widget
  • anchor=NSEW (or subset) - position widget according to given direction
  • before=widget - pack it before you will pack widget
  • expand=bool - expand widget if parent size grows
  • fill=NONE or X or Y or BOTH - fill widget if widget grows
  • in=master - use master to contain this widget
  • in_=master - see 'in' option description
  • ipadx=amount - add internal padding in x direction
  • ipady=amount - add internal padding in y direction
  • padx=amount - add padding in x direction
  • pady=amount - add padding in y direction
  • side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.
  • )
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()






Comments