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

T

Tina Li

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top