Python Devlopment






checkbutton



To select any number of options by displaying a number of options to a user as toggle buttons. The general syntax is:

cb = CheckButton(win, option=value)

There are number of options which are used to change the format of this widget. Number of options can be passed as parameters separated by commas. Some of them are listed below.

  • Title: To set the title of the widget.
  • activebackground: to set the background color when widget is under the cursor.
  • activeforeground: to set the foreground color when widget is under the cursor.
  • bg: to set he normal backgrouSteganography
  • command: to call a function.
  • font: to set the font on the button label.
  • image: to set the image on the widget.
Example: 
from Tkinter import *
win.title('My check Button')
win.geometry(350x250')
var1=IntVar()
cb1=Checkbutton(win,text="Male", variable=var1)
cb1.grid(row=0,sticky=W)
var2=IntVar()
cb2=Checkbutton(win,text="Female", variable=var2)
cb2.grid(row=1,sticky=W)
win.mainloop()