> Something like [NSPopUpButton removeAllItems] (but for menu bar item) ?
>
> Or each submenu/item menu must be removed one each at time ?
> How do this ?
The following works:
- (void)removeAllItemsOf:(NSMenu *)menu {
int i, iCount = [menu numberOfItems];
for (i = iCount - 1;0 <= i; --i) {
[menu removeItemAtIndex:i];
}
}
mhz - 26 Nov 2007 00:18 GMT
> > Something like [NSPopUpButton removeAllItems] (but for menu bar item) ?
> >
[quoted text clipped - 9 lines]
> }
> }
But what happen to all submenus in these items. And all items for these submenus. Etc..
Gregory Weston - 26 Nov 2007 12:00 GMT
> > > Something like [NSPopUpButton removeAllItems] (but for menu bar item) ?
> > >
[quoted text clipped - 12 lines]
> But what happen to all submenus in these items. And all items for these
> submenus. Etc..
Unless your code is retaining them, they're gone.