I am attempting to create a checkbox list using Tkinter in python,
I am add all components and button
but i dint know how to retrieve the values from the components, ( I want to retrieve the values such as: Sun, Mon… that will be checked and save it in the list after enter the button)
the code below reflects what I am attempting to describe:
from Tkinter import *
top = Tk()
mb= Menubutton ( top, text="CheckComboBox", relief=RAISED )
mb.grid()
mb.menu = Menu ( mb, tearoff = 0 )
mb["menu"] = mb.menu
Item1 = StringVar()
Item2 = StringVar()
Item3 = StringVar()
Item4 = StringVar()
Item5 = StringVar()
mb.menu.add_checkbutton ( label="Sun", variable=Item1)
mb.menu.add_checkbutton ( label="Mon", variable=Item2)
mb.menu.add_checkbutton ( label="Teu", variable=Item3)
mb.menu.add_checkbutton ( label="Wed", variable=Item4)
mb.menu.add_checkbutton ( label="Fri", variable=Item5)
Could you please help me ASAP to solve this problem
New contributor
AB1506 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.