Re: Custom NSView for Selection Rect...
Re: Custom NSView for Selection Rect...
- Subject: Re: Custom NSView for Selection Rect...
- From: "Peters, Brandon" <email@hidden>
- Date: Wed, 15 Oct 2014 00:42:57 +0000
- Thread-topic: Custom NSView for Selection Rect...
Graham,
I will look into your suggestion. Also, I want the ability to draw the selection box “outside” of the image, similar to what the Preview application allows.
On Oct 14, 2014, at 8:02 PM, Graham Cox <email@hidden> wrote:
>
> On 15 Oct 2014, at 8:21 am, Peters, Brandon <email@hidden> wrote:
>
>> I am using a custom NSView as a selection rect. I also have a NSScrollView with a custom NSClipView and a document view. Should I make the selection rect (custom view) a subview of the document view or the clip view? What is best practice for this?
>
> If you are determined to do it this way, it should be a subview of your content (document).
>
> But I don't think you should do it this way. Since you already have a custom view containing your content, why not just give it a "selection rect" property that you use to draw the selection after (i.e. "on top" of) all the other content? Chances are it'll be much simpler to figure out what objects the selection rect is touching or enclosing, and driving it using the mouse, etc. With a separate view, you'll likely end up with a much more complicated way to determine these things. K.I.S.S.
>
> Also, what's the reason for the custom clip view?
>
> --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