How to query object of GUI?
cosmo_general at yahoo.com
Wed Apr 15 06:56:16 CEST 2009
I need to query the ID of GUI, in Tkinter, but don't know how to do
it. This is my code:
top = Menu(self)
menObj = Menu(top)
labels = read_from_database()
for lab in labels:
# here I need query which menu item was clicked
For GUI Entry, there is a resource name textvariable, so I can use
textvariable to distinguish one Entry from the others. But, I can't
find such a resource name for Menu. I also noticed label is an
identifier, but I have no idea how to get it. Can somebody help me
out? Thanks in advance!
More information about the Python-list