Re: Drag and drop items between list views
Posted by
MartinW on
Apr 03, 2014; 8:55pm
URL: https://forum.world.st/Drag-and-drop-items-between-list-views-tp4752285p4752625.html
Goubier Thierry wrote
Another approach, that I would use, is to put more complex objects
inside the lists. Thoses objects would know how to get added / removed
from their respective collections, and then I would propagate collection
changes to the ListModel instances.
That sounded promising. I made a Collectible class. It's instances know how to add themselves to a collection (i'm not sure if that's a good idea, but as experiment..)
The problem is, i never get to these objects in my acceptDropBlock. In
list1 acceptDropBlock: [ :transfer :event :source :receiver :index |
transfer passenger do: [:element | element addSelfToCollection: collection1] ].
the element is only a ByteString - the name of my Collectible object. :(
Are there other possibilities if i do not use Spec?