Thank you. This is a step forward. The thing is i can't hardcode the collections. In the end product i don't have two but seven lists, so i must be able to detect in the acceptDropBlock which is the receiving collection/list. Goubier Thierry wrote
Ok, look at that code:
| collection1 collection2 list1 list2 | collection1 := #(1 2 3 4 5) asOrderedCollection. collection2 := #($a $b $c $d $e) asOrderedCollection. list1 := ListModel new. list1 items: collection1. list1 dragEnabled: true. list1 dropEnabled: true. list1 acceptDropBlock: [ :transfer :event :source :receiver :index | transfer passenger do: [:e | collection1 insert: e first before: index. collection2 remove: e first]. list1 items: collection1. list2 items: collection2 ]. list1 openWithSpec. list2 := ListModel new. list2 items: collection2. list2 dragEnabled: true. list2 dropEnabled: true. list2 acceptDropBlock: [ :transfer :event :source :receiver :index | self halt ]. ^ list2 openWithSpec
Now you can drag and drop from list2 to list1, and I think the code is good for drag and drop of multiple items.
-- View this message in context: http://forum.world.st/Drag-and-drop-items-between-list-views-tp4752285p47523... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.