I've been putting together a drawing package using layers and having a terrific time! But I'd appreciate a bit of guidance on the recommended approach for highlighting a layer as the mouse moves over the layer. This is intended to give the user positive feedback as to which drawing element the mouse is actually hovering over. There is a bezier path describing the boundaries of the drawing object. A nice bloom highlight around the boundaries of the path would be perfect. Perhaps it could even have a mild 'throb'.

Obviously, the containing view has to handle the mouse movement detection--layers don't get events. At first I was thinking the view could set a 'hovering' property on the layer and have an action take care of the animation but then realized that actions are probably most appropriate for transitions, and this is more of a 'state'.

Currently, I'm thinking that the master view would just tell the appropriate layer (a specialization of CALayer) that's it's being hovered and the layer would add the highlighting (probably a sublayer with a copy of the bezier path which is simply drawn). Alternately, the view could just add the sublayer and let it determine its superlayer's path.

Is this the right approach or is there a better way?

Thanks,
Mike

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to