how to know the number of menu items in a cascade (sub) menu?

Tina Li tina_li23AThotmailDOTcom
Mon Sep 22 12:38:27 EDT 2003


Hello,

I have a menu, "Foo", and a cascade submenu under it, called "Bar", that has
a number of menu items. If I want to delete all of the menu items under
"Bar", but would like to keep "Bar" (i.e. an empty cascade menu with no
items), how do I know how many items there are?

I assume I should use

deletemenuitems("Bar", 0, ???)

It's the last parameter ("end") that I don't know what to put in. I tried to
access "Bar" via self.menuBar.component("Foo-menu_Bar"), or to get the END
index of "Bar" via self.menuBar.component("Foo")[1].index("end") (because
Bar is the second submenu under Foo. I know, hard-coding is bad) but they
don't work.

Thanks much for your help!!!


Tina



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----




More information about the Python-list mailing list