populate/resize an already open NSMenu in background
populate/resize an already open NSMenu in background
- Subject: populate/resize an already open NSMenu in background
- From: Martin Wierschin <email@hidden>
- Date: Fri, 19 Dec 2008 13:21:48 -0800
Hi everyone,
I have a menu that needs to be populated on demand, so I've set an
NSMenu delegate and note the update request in "menuNeedsUpdate:".
The problem is that populating the menu can take quite a while, so
results need to be generated in the background and then added as they
come in. Think of something like the system Spotlight menu, where
file matches are appended as they are found.
The problem is that the NSMenu will not resize itself to show items
added from outside of "menuNeedsUpdate:". If I call "update" and/or
"resizeToFit" the menu does change its display to show the changed/
reordered items, but never resizes itself beyond the capacity
established in "menuNeedsUpdate".
Has anyone ever gotten this kind of thing to work? I do notice that
moving the mouse to hide the menu and then reshow it allows the
NSMenu to resize itself as needed. Perhaps I should look into faking
mouse events to trigger this kind of thing programmatically- seems
like a horrible hack.
Thanks for any advice,
~Martin
_______________________________________________
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