Checkbutton widget in tkinter in python by R4R Team

The Checkbutton widget is used to display a number of options to a user as toggle buttons. The user can then select one or more options by clicking the button corresponding to each option.


Syntax-

c=Checkbutton(window,option=value)
// Here option=value means that there are also some other option which change the figure of the checkbutton.


program-



from tkinter import *
#create a window screen
win=Tk()
win.geometry("300x300")

c1=Checkbutton(win,text="Click1")
c1.place(x=40,y=100)

c2=Checkbutton(win,text="Click2")
c2.place(x=40,y=120)

c3=Checkbutton(win,text="Click3")
c3.place(x=40,y=140)

#hold the screen
win.mainloop()


output-



-In this program, we firstly create a window screen that works as a platform for other widget, then we create a Checkbutton.
-Here c.place(x,y) place a Checkbutton widget at (x,y) coordinates.
-In above output, checkbuttons are not checked

After click on Checkbuttons -



Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!