checkbox.check_state initialization fixed

This commit is contained in:
Mohsen Sadi 2022-06-08 07:11:52 -04:00
parent 0f7cb22b1b
commit 6e36ec818e

View File

@ -63,7 +63,10 @@ class CTkCheckBox(CTkBaseClass):
self.function = command
self.state = state
self.hover = hover
self.check_state = (variable.get() == onvalue)
if variable == None:
self.check_state = False
else:
self.check_state = (variable.get() == onvalue)
self.onvalue = onvalue
self.offvalue = offvalue
self.variable: tkinter.Variable = variable