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: NSView clickable area




On Nov 17, 2007, at 10:30 PM, Christian Schmitz wrote:

Hi,

my NSView in the Statusitem bar does not get mouse events on areas which
are transparent. Users are complaining about this.


If you want to know how the bahavior is, just thing about if you click
on the menubar clock and the menu there would only open if you hit the
black text. If you hit the space between the letters or inside the
letters, you won't open the menu.

How do I make a NSView to handle events on the whole size?
And how does the system know where I don't have it transparent?

Seems like if I draw it all in red using fillrect, I get all events I
expect. But if there is just a small icon, the space around is ignored.
Somehow the system seems to thing it needs to watch on the alpha mask.

Well pretty much all of Mac OS X hit detection works considering opacity. I bet you can use a white fill at like 5% or a little more to get the OS to do the hit detection you want without making it visible to the user.


Note on Leopard I don't see this behavior nor do I recall it on Tiger but I will take your word for it.

-Shawn
_______________________________________________

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: 
 >NSView clickable area (From: email@hidden (Christian Schmitz))



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.