Mar 09

I got Drag And Drop working with the File Manager now. To do it I had instead of a normal ListStore declare a ListStoreDND. When declaring a drag’n'drop listStoreDND, you have to defined you’re DND functionality there and then, which is quite annoying to be honest. An `onRowDrag` function would be a lot better, and in keeping with the rest of the library and how actions are done. Also, when you are doing a drag, you have to put data into a “selection” and in the library documentation I could see functions like “selectionSetText”, and “selectionGetText”, which looked like they’d be very useful to me. Denied. You can only put numbers into a selection, and there was one line about this somewhere near the bottom of the library documents. Why have a method like selectionSetText if you can’t set the text in the selection? Makes no sense at all. Regardless, what I do to get around this is: Feed a 0 or 1 into the selection depending on what store the row is being dragged from. Then feed the selected row’s index into it. The if the first number in the selection is 0, I know its from the directory store. So I just pop off the text at that index, and then the text from the dropping position, and then do a move with those. Happy days.

Will post code later when I tidy it up.

M

Tagged with:
preload preload preload