Re: Trying to understand weird NSOutlineVew behaviour
Re: Trying to understand weird NSOutlineVew behaviour
- Subject: Re: Trying to understand weird NSOutlineVew behaviour
- From: Quincey Morris <email@hidden>
- Date: Wed, 16 Mar 2016 22:24:52 -0700
- Feedback-id: 167118m:167118agrif8a:167118sN99X6L_18:SMTPCORP
On Mar 16, 2016, at 20:53 , Graham Cox <email@hidden> wrote:
>
> This is slightly different from the standard drag/drop stuff built-in to the table, which appears to divide each row approximately into thirds (not halves) when deciding which row the drag is over. Depending on exactly which item the row represents, I need to look at halves or thirds.
I dunno, but I suspect you’re trying to do something that’s not well-defined in this context.
What I mean is, it’s not clear that there *is* a well-defined answer to the question “what row is this point in?” inside a validateDrop delegate method invocation. Obviously, it’s well-defined in a simplistic geometric sense, but the outline view is in the process of doing something more complicated.
You’re not being asked to approve or reject a translation of a point to a row, you’re being asked to approve or reject an outcome that’s been chosen in an opaque way. The original point may be more or less irrelevant by the time this question is asked.
In particular, IIRC there may be multiple calls to validateDrop. For example, if it proposes dropping “on” an item, and you refuse the drop, it will then propose dropping “above” or “below”. (That’s my recollection, but it’s a couple of years since I delved into this, so I may misremember.) Also, horizontal position matters: the proposed target depends on how far left or right the mouse is.
You’re expected to accept the proposal, or reject the proposal, or to retarget based on the proposal. You may be being expected not to second-guess what’s going on by changing the meaning of the question.
If it’s a row that can’t accept a drop “on” — a context where you say you need “halves” — what happens if you simply refuse the drop? Are you sure you really need to convert the point to a row index at all?
Of course, it *is* strange that ‘rowAtPoint’ doesn’t return at least the simplistic answer. However, NSOutlineView is nothing if not strange.
_______________________________________________
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