1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
def on_cb1_toggled():
if cb1_var.get():
# Si la checkbox est checkée
bouton2.deselect(bouton2)
combo3.configure(state='disabled')
combo4.configure(state='disabled')
else:
# Sinon
combo3.configure(state='enabled')
combo4.configure(state='enabled')
def on_cb2_toggled():
if cb2_var.get():
# Si la checkbox est checkée
bouton1.deselect(bouton1)
combo1.configure(state='disabled')
combo2.configure(state='disabled')
else:
# Sinon
combo1.configure(state='enabled')
combo2.configure(state='enabled')
cb1_var = Tkinter.IntVar()
bouton1=Checkbutton(fen1,text="Type d'un céréale durant des années ",
variable=cb1_var, command=on_cb1_toggled)
bouton1.grid(row=3, column=1, sticky=NW)
cb2_var = Tkinter.IntVar()
bouton2=Checkbutton(fen1,text="Comparaison des céréales pendant des années ",
variable=cb2_var, command=on_cb2_toggled)
bouton2.grid(row=5, column=1, sticky=NW) |
Partager