Drag & Drop

Mac OSX specific forum
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Drag & Drop

Post by wombats »

Unfortunately, Drag & Drop is still broken on macOS.

Is there a way to do it ourselves through the CocoaMessage command?
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Drag & Drop

Post by wilbert »

I think it might be possible.
What do you exactly want ?
Windows (x64)
Raspberry Pi OS (Arm64)
wombats
Enthusiast
Enthusiast
Posts: 663
Joined: Thu Dec 29, 2011 5:03 pm

Re: Drag & Drop

Post by wombats »

I want to be able to reorder the items of gadgets - particularly the TreeGadget and ListIconGadget.
User avatar
Shardik
Addict
Addict
Posts: 1989
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Drag & Drop

Post 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:
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Drag & Drop

Post 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:
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply