I've tried this - non-public APIs don't scare me - but when I set an event handler on the contentView, I didn't get kEventControlGetFrameMetrics. I only get it on the contentView's superview, but it doesn't have one at awakeFromNib time. I have to wait until it gets a kEventControlOwningWindowChanged and add it then, but that's too late for the first time the menu appears - though it does work fine after that.

Is there something I'm missing?

On Jan 26, 2008, at 9:59 PM, Eric Schlegel wrote:


On Jan 26, 2008, at 8:45 PM, Pierre Bernard wrote:

Trouble starts when I want my view to draw a background (like the
blue background used by Spotlight), I find that there remains a
white area above and below my view which is drawn by the menu
itself. What I am after is a way to get rid of that border.

The Help menu removes that white border by installing a Carbon event
handler for kEventControlGetFrameMetrics on the menu content view
(HIMenuGetContentView) and returning a top metric of zero pixels.
Unfortunately there's no public way to get the MenuRef from an NSMenu,
so I'm not sure this approach is viable if you only want to use public
API.

-eric

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/lrucker%40vmware.com

This email sent to lruc...@vmware.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to