Tkinter: is there a way to check checkboxes by default?

后端 未结 4 863
天涯浪人
天涯浪人 2020-12-10 14:43

I have this piece of code that will create a simple checkbox :

from Tkinter import *

CheckVar = IntVar()
self.checkbutton = Checkbutton(self.root, text = \"         


        
4条回答
  •  生来不讨喜
    2020-12-10 15:05

    var4 = IntVar(value=1)
        Checkbutton(root, text="New", variable=var4, bg="light green").grid(row=12, column=0)
    

    This code will check all the boxes when you run the program.

提交回复
热议问题