from Tkinter import *
window = Tk()
CheckVar1 = IntVar()
cbttn = Checkbutton(text="Caps?", variable = CheckVar1, \
onvalue = 1, offvalue = 0, height=5, \
width = 20)
cbttn.grid(row=3, column=0)
while True:
if CheckVar1 == 0:
a = Button(text="a").grid(column=1)
b = Button(text="b").grid(column=1)
c = Button(text="c").grid(column=1)
d = Button(text="d").grid(column=1)
e = Button(text="e").grid(column=1)
f = Button(text="f").grid(column=1)
g = Button(text="g").grid(column=1)
if CheckVar1 == 1:
A = Button(text="A").grid(column=1)
window.mainloop()#makes everything work
I want to find out how to make different buttons appear depending on what the value of CheckVar1
is.
I have no errors, but the code I want to work are the if CheckVar1 == 0:
and if CheckVar1 == 1
.