On 15 Oct 2014, at 8:21 am, Peters, Brandon <bap...@my.fsu.edu> 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 (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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to