Page 1 of 1

Drag & Drop

Posted: Sun Feb 11, 2018 7:28 am
by wombats
Unfortunately, Drag & Drop is still broken on macOS.

Is there a way to do it ourselves through the CocoaMessage command?

Re: Drag & Drop

Posted: Sun Feb 11, 2018 9:57 am
by wilbert
I think it might be possible.
What do you exactly want ?

Re: Drag & Drop

Posted: Sun Feb 11, 2018 3:53 pm
by wombats
I want to be able to reorder the items of gadgets - particularly the TreeGadget and ListIconGadget.

Re: Drag & Drop

Posted: Sun Feb 11, 2018 4:11 pm
by Shardik
Did you already try my workaround (hidden thread) for ListIconGadgets? It has the big disadvantage that you have to wait some seconds after selecting a cell and before you may click a 2nd time onto that cell to move it. But at least it's working (kind of)... :wink:

Re: Drag & Drop

Posted: Sun Feb 11, 2018 4:13 pm
by wilbert
wombats wrote:I want to be able to reorder the items of gadgets - particularly the TreeGadget and ListIconGadget.
It looks like in order to do that, you will have to implement certain methods for NSTableViewDataSource / NSOutlineViewDataSource .

I found a Swift example.
https://gist.github.com/sooop/3c964900d ... 5050d0de0a
Looking at the code, it appears you need to implement the following methods for the ListIconGadget.

tableView:writeRowsWithIndexes:toPasteboard:
tableView:acceptDrop:row:dropOperation:
tableView:validateDrop:proposedRow:proposedDropOperation: