Pulldown Menu Entry Callbacks.

Anoop Srivastava (71700.1052@CompuServe.COM)
19 Jan 1995 15:35:41 GMT

I have a question regarding pulldown menus using Python/Tk.

Does anybody know how to add arbitrary data to pulldown-menu entry
callbacks? Suppose I want to have several menu-entries all using the
same callback but in the callback I wish to find out some unique information
about the item generating the callback. A simple case would be to read
a file and create a menu-entry for each line in the file. When any entry
is chosen, the callback simply prints the text from the menu-entry.

Since you won't know the number of entries in the file before hand, you
can't write a unique callback for each item.

Any help would be greatly appreciated.

Ken Howard
howard@comsoft.com

-- 
anoop@comsoft.com