Re: Updating NSMenu while it's open
Re: Updating NSMenu while it's open
- Subject: Re: Updating NSMenu while it's open
- From: Uli Kusterer <email@hidden>
- Date: Thu, 19 Apr 2012 09:38:42 +0200
On 19.04.2012, at 04:46, Dave DeLong wrote:
> That's slightly different. That's run by NSMenuItem's "alternate" mechanism. It sounds like what the OP was asking for was dynamically adding and removing NSMenuItems while the menu is open.
Just a short caveat: If this menu can change a lot, it will be really annoying to the user if it does so while the menu is pulled down. Imagine a user trying to select an item and another one suddenly being inserted right above it, causing her to pick the wrong menu item at the last split-second. It's good idea to sort items in the menu in a way that keeps their order stable even when new items are added.
The worst thing one can do is use an unstable sort algorithm causing two items to repeatedly change places. Using Finder on the "Preferences" folder is approaching that level of annoyance these days, it's nigh-impossible to select files from there when sorted by date, because a few files change constantly.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden