I am trying to create a combo box with a checkbox against each item. I am not able to select multiple items at one go as every time I have to click the drop-down and select one. Also, It collapses every time I select one item.
from tkinter import *
root = Tk()
main = Menubutton(root,text="Various Dates")
main.grid()
main.menu = Menu(main,tearoff=0)
main['menu'] = main.menu
Date0 = StringVar()
Date1 = StringVar()
Date2 = StringVar()
Date3 = StringVar()
main.menu.add_checkbutton(label='22/03/2024',variable=Date0)
main.menu.add_checkbutton(label='24/03/2024',variable=Date1)
main.menu.add_checkbutton(label='26/03/2024',variable=Date2)
main.menu.add_checkbutton(label='28/03/2024',variable=Date3)
main.pack()
root.mainloop()
The above code creates a simple Dropbox but every time it collapses after selecting an option. I need the dropdown to be open until I select multiple options and once I click dropdown it should collapse like below.