I have a for:
loop which creates a tkinter menu cascade for every mailbox my email server has, all pointing to the same command, here's that code:
menubar = Menu (rootA)
foldermenu = Menu(menubar, tearoff=0)
for i in range(len(mailboxes)):
foldermenu.add_command(label=mailboxes[i], command=switchBox)
But I need a way to identify exactly which button was clicked within my code, so is there any way to return the 'label' of the menu selection you just made or return an index or otherwise? for example the tkinter listbox has the function .curselection()