I've already added the code for drag and drop to the iconview widget, but I haven't found any method for dragging two or more items: every time an item is selected, the previous selection is cleaned.
Asked
Active
Viewed 125 times
2 Answers
1
You probably have it set to single selection mode. Try:
iconview.set_selection_mode(Gtk.SelectionMode.MULTIPLE)
The docs.
Edit: To pick and choose, you need to CTRL + click. To straight line select from one point to another - click, and then SHIFT + click.

theGtknerd
- 3,647
- 1
- 13
- 34
-
Already done. Yes, I can select multiple items, but the next time I click on one item, without releasing the mouse button, all the previous selection is cleared, I cannot drag two or more items at the same time. – franky99 Feb 17 '18 at 08:59
-
@theGtknerd I think that does not answer the question which is specifically about drag and drop. Most developers and power users know how to select multiple elements. Usually you can click and drag the selection somewhere else (possibly combined with Ctrl for duplication or Shift for moving, but it should also work without holding any key but the mouse button). The goal here is to achieve this with Python-Gtk3. – dreua Nov 04 '18 at 16:24
-
@dreua The OP specifically states that DND **is** added (and I assume it also works), but that multiple selection is not. And according to his comment, he didn't know how to pick and choose items in a non-linear pattern. – theGtknerd Nov 04 '18 at 17:29
0
A lot later I had the same problem. IconView at least now supports that by default (if Ctrl is held).
Note that your application must have keyboard focus.

Gtk Fan
- 45
- 6