self.var1 = tk.BooleanVar() self.var1.set(False) print(self.var1.get()) self.ck_breakfast = tk.Checkbutton(self.reserve_win,text='Breakfast',variable=self.var1,font=('Helvetica',20),command=self.change_tick) self.ck_breakfast.grid(row=0,columnspan=2,padx=10,pady=3) def change_tick(self): print(self.var1.get())
In this program, I am not able to change
self.var1.get() into True after I put a tick on the checkbutton. I also tried to initialize it as False but after putting a tick it still remains the value as False. May I ask is there any methods to change it to True after a tick put on the checkbutton?