Re: NSOutlineView: prevent item to expand on drag
Re: NSOutlineView: prevent item to expand on drag
- Subject: Re: NSOutlineView: prevent item to expand on drag
- From: Fabien Conus <email@hidden>
- Date: Wed, 15 Sep 2004 16:31:38 +0200
On Wed, 15 Sep 2004 15:19:13 +0200, Allan Odgaard <email@hidden> wrote:
> On 15. Sep 2004, at 14:31, Fabien Conus wrote:
>
> > When dragging something in a NSOutlineView, the items will
> > automatically expand when you spend some time on them.
> >
> > How can I prevent that ?
>
> You do know that this is actually a feature, right? ;)
Sure....but not in my case :-)
>
> Anyway, try to implement the outlineView:shouldExpandItem: delegate
> method to prevent expansion during drag'n'drop -- I haven't tested if
> it works though (there's probably a good chance it won't work, but it's
> worth a shot).
This is exactly what I tried...but I don't think it will work.
This is how I see it:
In the "outlineView:validateDrop:proposedItem:proposedChildIndex:"
implementation of the datasource, I set a global boolean variable
"canExpand" to false. In the "outlineView:shouldExpandItem:" method I
return this variable.
Now, in the "outlineView:acceptDrop:item:childIndex:" implementation,
I set "canExpand" back to true.
This seemed to be a good idea....
...but what if the user decides not to drop, to abort the drag ? My
variable will never be set back to true :-(
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden