Question: I am trying to make my check buttons in python tkinter to be deselected if the no toppings button is checked and otherwise all other
I am trying to make my check buttons in python tkinter to be deselected if the no toppings button is checked and otherwise all other options could be checked. How to I edit my code to achieve this?
# creating label for taco toppings
toppinglabel Labelselforderframe, text"Taco Toppings:", fontlabelfont, fgcolorfont
toppinglabel.gridrow column stickyE
# creating list for topping options
toppingoptions
"None",
"Pico",
"Cheddar Cheese",
"Sour Cream",
"Pickled Red Onions",
"Jack Cheese"
# declaring variable as string for no topping option
noneselected StringVar
noneselected.setnoneselected.get
# declaring variable as string for pico option
picoselected StringVar
picoselected.setpicoselected.get
# declaring variable as string for cheddar cheese option
cheddarcheese StringVar
cheddarcheese.setcheddarcheese.get
# declaring variable as string for sour cream option
sourcream StringVar
sourcream.setsourcream.get
# declaring variable as string for pickled onions option
pickledonions StringVar
pickledonions.setpickledonions.get
# declaring variable as string for jack cheese option
jackcheese StringVar
jackcheese.setjackcheese.get
# creating check buttons for each taco topping
# check box for no toppings
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablenoneselected,
onvalueNo Toppings", offvalue fginputcolor, fontlabelfont
self.toppingoptions.select
self.toppingoptions.gridrow column stickyW
# check box for pico topping
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablepicoselected,
onvalue"Pico offvalue fginputcolor, fontlabelfont
self.toppingoptions.deselect
self.toppingoptions.gridrow column stickyW
# check box for cheddar cheese
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablecheddarcheese,
onvalue"Cheddar Cheese offvalue fginputcolor, fontlabelfont
self.toppingoptions.deselect
self.toppingoptions.gridrow column stickyW
# check box for sour cream
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablesourcream,
onvalue"Sour Cream offvalue fginputcolor, fontlabelfont
self.toppingoptions.deselect
self.toppingoptions.gridrow column stickyW
# check box for pickled red onions
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablepickledonions,
onvalue"Pickled Red Onions offvalue fginputcolor, fontlabelfont
self.toppingoptions.deselect
self.toppingoptions.gridrow column stickyW
# check boc for jack cheese
self.toppingoptions Checkbuttonselforderframe, texttoppingoptions variablejackcheese,
onvalue"Jack Cheese offvalue fginputcolor, fontlabelfont
self.toppingoptions.deselect
self.toppingoptions.gridrow column stickyW
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
