How to make a graded combobox in python Tkinter? Like if we choose a value from first combobox menu, then the next combobox menu will show only values that inside the first selected combobox value category.
This is my code:
BU = StringVar()
BU.set("")
def BU(BU_choices):
s = BU.get()
BU_choices = ["DUM", "IND", "KAM", "RAP"]
BU_drop = OptionMenu(Canv, status, *BU_choices, command=BU)
BU_drop.config(bg="white", fg="dark blue", width=3, relief=GROOVE)
BU_drop.place(x=130, y=110)
sector = StringVar()
sector.set("")
def sector(sector_choices):
s = sector.get()
sector_choices == selected_sector
if BU.get() == "DUM":
selected_sector = ["GRG", "LBO", "KBU", "PLS"]
elif BU.get() == "IND":
selected_sector = ["BYS", "MER", "NGD", "PER"]
sector_drop = OptionMenu(Canv, status, *sector_choices, command=sector)
sector_drop.config(bg="white", fg="dark blue", width=3, relief=GROOVE)
sector_drop.place(x=130, y=150)
Any Suggest?