tkinter.Checkbutton.grid


Definition
Position a Checkbutton in the parent widget in a grid.

Syntax
pack().grid()
grid_configure(self, cnf={}, **kw)

Options
  • Checkbutton(
  • column=number - use cell identified with given column (starting with 0)
  • columnspan=number - this widget will span several columns
  • 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
  • row=number - use cell identified with given row (starting with 0)
  • rowspan=number - this widget will span several rows
  • sticky=NSEW - if cell is larger on which sides will this widget stick to the cell boundary
  • )

Examples
The method adjusted text alignment through Checkbutton.grid().
 from tkinter import*
master=Tk()

checkbutton1=Checkbutton(master,text="C1")
checkbutton1.grid(row=1,column=0)

checkbutton2=Checkbutton(master, text="C2")
checkbutton2.grid(row=1,column=2)

checkbutton3=Checkbutton(master,text="C3")
checkbutton3.grid(row=0,column=1)

checkbutton4=Checkbutton(master,text="C4")
checkbutton4.grid(row=2,column=1)

master.mainloop()









Comments