Re: highlight a nsview on click-drag?
Re: highlight a nsview on click-drag?
- Subject: Re: highlight a nsview on click-drag?
- From: Graham Cox <email@hidden>
- Date: Sun, 15 Mar 2015 14:50:36 +1100
> On 15 Mar 2015, at 3:44 am, Patrick J. Collins <email@hidden> wrote:
>
> Is there anything built-in that does this for me?
No.
You need to stop thinking this way. Cocoa does a lot, but it doesn't do everything. It goes only as far as very general solutions to very general application needs - a view for example, stops at the point where it gives you a rectangular chunk of screen space to draw into. Beyond that, you are into specifics that pertain to your app only, and as such, you have to code them.
There are many ways to implement a selection rectangle, but the best/right way for you depends on what you intend it to do. Ergo, you have to write that code to suit your own requirements.
A fairly simple way to implement a selection rectangle is to use CALayer, but that only gives you the visual aspect. What does it select? Answer that question first and that will tend to lead you to the appropriate way to implement it.
--Graham
_______________________________________________
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