Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change a NSMenu's shape?



Hey Peter and Ken,

thanks for taking the time to respond.

Can you use -[NSStatusItem setMenu:]?  If not, could you please file a
bug describing why?

Unfortunately, I can't. These are status items that also serve as drag & drop targets and one-click action triggers, depending on their context. In fact, my application's needs are so special that even this strategy ...


You may use -[NSStatusItem popUpStatusItemMenu:] to pop up an arbitrary menu with the correct appearance for a main menu (the sharp top corners).

... doesn't really work out, because this application pops up its NSStatusItem menus via PopUpMenuSelect() after getting their MenRefs by means of the undocumented _NSGetCarbonMenu() function. So filing a bug is kind of pointless, I guess. And I know that every time I use undocumented calls a little kitten dies, but it was the only way to achieve certain things (e.g., populate NSMenus while traversing them in order to browse your file system from a NSStatusItem) back in the Mac OS X 10.2 days.


Right now, I am actually rewriting these parts of my application to use -[NSStatusItem popUpStatusItemMenu:] in a new version that won't have to support 10.2 anymore; but that will take some more time, and in the mean time, I had hoped there would be a quick and dirty way to fix this cosmetic issues for Leopard users. However, if there isn't, I can live with that, too. Turns out it doesn't look quite as ridiculous if I simply move my menus 4 units to the left when running on Leopard.

BTW: I've always fantasized about being able to use the proper Dock context menu style (the one that "points" to a Dock icon), instead of having to ape it. But since we can't even change the corners' appearance, I guess that's out of the question completely. ;-)

Thanks again!

Peter.
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Change a NSMenu's shape? (From: Peter Maurer <email@hidden>)
 >Re: Change a NSMenu's shape? (From: "Ken Ferry" <email@hidden>)
 >Re: Change a NSMenu's shape? (From: Peter Ammon <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.