Re: Dnd multiple items from Treeviews not possible?

В Втр, 11/03/2008 в 11:55 +0100, Luca Vezzaro пишет:
> Hello, I'm having an issue with TreeView drag & drop and multiple selection.
> Each time I click on the "source" treeview to drag multiple items onto
> another widget the selection is changed and only the item I've just
> clicked is dragged. Holding SHIFT while dragging solves the problem,
> but it has the unpleasing effect of deselecting the clicked item if it
> was previously selected.
> I've been referred to this bug
> and invited to handle
> the issue through widget customization, but what I want is a quick
> fix, don't have the time to fiddle with the widget customization
> process. I was thinking about saving the selection inside the
> "selection_changed" callback and restore that old selection when the
> "drag_get" callback is called if needed... Anyone has some better
> proposal?
> I'm not using the built-in treeview dnd interface, will using that
> solve my issues, or is it only intended to be used for sorting?
> Sorry if I made stupid or already asked questions, I did some search
> but couldn't find the answer I'm looking for.
> Thanks for the attention,

Personally, I would to use this solution - handle mouse events prior to
treeview inner callbacks.

button_press_event - ignore left (1st) mouse button PRESSED, do
selection when left button RELEASED, if no DnD (or some else) event

motion_notify_event - start DnD if left mouse button held, disable
(ignore) this event until DnD finished.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]