Re: Rearranging NSOutlineView via drag-and-drop

2015-02-03 Thread Akis Kesoglou
> But in my app, whether an item has children or not can affect which icon > appears beside it in the list. Unfortunately, reloadItem: doesn't request a > view, which would call the function that assigns icons, nor can I figure out > how to ask the outline for the view after my delegate creates

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Charles Jenkins
Thanks to everyone for the info about viewForTableColumn:item:. I overlooked it somehow in my search. You're right, I do all the configuration in outlineView:viewForTableColumn:item:, but when I tested using reloadItem: on affected nodes of the tree, the disclosure triangles got updated but

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Kyle Sluder
On Jan 5, 2015, at 10:48 AM, Charles Jenkins wrote: > > Well, the view-based outline view calls my delegate to get the view pointer > for a given item, and in response my delegate dutifully creates one, sets its > text and image, and hands it over. But after that the item view I created is > o

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Quincey Morris
On Jan 5, 2015, at 10:48 , Charles Jenkins wrote: > > Well, the view-based outline view calls my delegate to get the view pointer > for a given item, and in response my delegate dutifully creates one, sets its > text and image, and hands it over. Creating the cell view and populating the cell

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Ken Thomases
On Jan 5, 2015, at 12:48 PM, Charles Jenkins wrote: > Well, the view-based outline view calls my delegate to get the view pointer > for a given item, and in response my delegate dutifully creates one, sets its > text and image, and hands it over. But after that the item view I created is > own

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Charles Jenkins
Well, the view-based outline view calls my delegate to get the view pointer for a given item, and in response my delegate dutifully creates one, sets its text and image, and hands it over. But after that the item view I created is owned by the outline view, and I think--but would be happy to be

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Quincey Morris
On Jan 5, 2015, at 05:12 , Charles Jenkins wrote: > > reloadItem: doesn't request a view What does “request a view” mean? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. C

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-05 Thread Charles Jenkins
In case it helps anyone, here's how my NSOutlineView rearranging story ends. I found that reloadItem: works perfectly well to update disclosure triangles. In my acceptDrop method, I tracked which parent items were affected by the move by adding them to an NSSet, then I use performSelector:with

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Charles Jenkins
Thanks, all. I’ll reload parent items. In my app, whether an item has children or not can change which icon appears in the tree, and the outline view has no way to know about that without a reload to cause it to requery the delegate. — Charles Jenkins On Sunday, January 4, 2015 at 7:06 PM, Ro

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Roland King
> On 5 Jan 2015, at 02:13, Quincey Morris > wrote: > > On Jan 4, 2015, at 05:39 , Roland King mailto:r...@rols.org>> > wrote: >> >> I had to reload the parent row to get it to call the isItemExpandable and >> other methods to either show a new disclosure triangle or remove one which >> was

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Quincey Morris
On Jan 4, 2015, at 05:39 , Roland King wrote: > > I had to reload the parent row to get it to call the isItemExpandable and > other methods to either show a new disclosure triangle or remove one which > was no-longer valid. That sounds at least halfway to being a bug. However, since (if I unde

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Roland King
> On 4 Jan 2015, at 21:33, Ken Thomases wrote: > > On Jan 4, 2015, at 7:22 AM, Charles Jenkins wrote: > >> moveItemAtIndex:… does indeed move the items around to the proper places in >> the tree, but the outline view control doesn’t update disclosure triangles. >> Meaning, if I drag an item’

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Roland King
> On 4 Jan 2015, at 21:22, Charles Jenkins wrote: > > Quincy: > > Thanks for the answer! But something is still missing... > > moveItemAtIndex:… does indeed move the items around to the proper places in > the tree, but the outline view control doesn’t update disclosure triangles. > Meaning

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Ken Thomases
On Jan 4, 2015, at 7:22 AM, Charles Jenkins wrote: > moveItemAtIndex:… does indeed move the items around to the proper places in > the tree, but the outline view control doesn’t update disclosure triangles. > Meaning, if I drag an item’s only child someplace else, the now-childless > parent ke

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Charles Jenkins
No, begin/end updates didn’t help. I’m still having the problem described below: On Sunday, January 4, 2015 at 8:22 AM, Charles Jenkins wrote: > Quincy: > > Thanks for the answer! But something is still missing... > > moveItemAtIndex:… does indeed move the items around to the proper pla

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Charles Jenkins
Oh, hang on… I bet I need to wrap the moves in a begin/end updates block. I’ll try that now. — Charles Jenkins On Sunday, January 4, 2015 at 8:22 AM, Charles Jenkins wrote: > Quincy: > > Thanks for the answer! But something is still missing... > > moveItemAtIndex:… does indeed move the

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-04 Thread Charles Jenkins
Quincy: Thanks for the answer! But something is still missing... moveItemAtIndex:… does indeed move the items around to the proper places in the tree, but the outline view control doesn’t update disclosure triangles. Meaning, if I drag an item’s only child someplace else, the now-childless p

Re: Rearranging NSOutlineView via drag-and-drop

2015-01-03 Thread Quincey Morris
On Jan 3, 2015, at 12:13 , Charles Jenkins wrote: > > These things work, and I can verify that the object graph in the model has > changed correctly. But to see the changes reflected in my Source View, I have > to collapse and re-expand the affected nodes in order to have them reload > data fr

Rearranging NSOutlineView via drag-and-drop

2015-01-03 Thread Charles Jenkins
I may have gone about things wrong, but I added drag-and-drop rearrangement to a source view by implementing these NSOutlineViewDataSource methods: outlineView:writeItems:toPasteboard: outlineView:validateDrop:proposedItem:proposedChildIndex: outlineView:acceptDrop:item:childIndex: If all sani