from tkinter import * wind = Tk () var_2 = BooleanVar () var_2.set (0) canvas = Canvas (width = 100, height = 100, background = '#FFFFFF') def draw (event): print (1) if var_2.get == True: x = event.xy = event.y x1 = x-2 y1 = y - 2 x2 = x + 2 y2 = y +2 canvas.create_oval (x1, y1, x2, y2, fill = 'black') else: print ('vr') canvas.bind ('', draw) canvas.pack () c_b_1 = Checkbutton (text = 'Draw', font = ("Comic Sans MS", 12), indicatoron = 0, variable = var_2, onvalue = 1, offvalue = 0) c_b_1.pack () wind.mainloop () The fact is that draw is executed, but the condition is always not satisfied. For this, I set the print('vr') check. How to make the condition satisfied when necessary. I checked the checkbox - everything is fine.
