drag and drop reordering of a list

yair reshef's icon

i have a list of numbers [1 5 8 4 9 56 ]
zl nth will do anything but i would love to reorder them with a graphic interface
anything out there?

yair reshef's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Roman Thilenius's icon

i would create the whole drag and drop thing using the [lcd] object for mouse tracking.

it will be a bigger patch, but such things are always a great training, and its result will
reusable for the next application.

-110

Roman Thilenius's icon

or acctually not a bigger patch when i think about it, drag and drop is pretty easy .. wait for mousedown, see at what position we are, wait until mouse is released, see at what position we are, trigger appropiate action.

yair reshef's icon

dono, cellblock handles most of that internally

yair reshef's icon

would be nice to have a bit of matrixctrl in jit.cellblock
like having more then one cell selected + list output in row/coll

Nikola Kołodziejczyk's icon

I have devised this method for a drag and drop with jit.cellblock and coll. Note that it updates only on MouseUp.
It is probably what Roman suggested.
(Drag the rows with mouse)

Max Patch
Copy patch and select New From Clipboard in Max.

Morgan's icon

@Nikola, your patch was super helpful, thanks! I modded it to only swap on dragging, looks a little more like spaghetti now heh.

Max Patch
Copy patch and select New From Clipboard in Max.

Dan Laüt's icon

Very ingenious, Nikola! But why the trigger after the join with its unconnected '1' outlet?

Dan Laüt's icon

I built this to reorder MIDI playlists, but it should work on any list fed to the coll (using listfunnel, for instance).

Max Patch
Copy patch and select New From Clipboard in Max.