does anyone knows if it is possible to make a gtk treeview drag/drop
sensitive (from the same app and/or from another app) and making it
reorderable?
It looks like it’s mutually exclusive: connecting the treeview to the
drag_data_received invalidates the reorderable property and setting
reorderable to true after making the signal_connect on
drag_data_receveived disables it.
It has been a while since I have messed with Ruby/Gnome2, but looking at
the
information available in the documentation, you should receive
Gdk::EventDND
for motions, EG when a drag and drop is occurring, you should receive
motion
events under the Gdk::EventDND. If you setup a DND on your root window,
you
can temporarily set your TreeView to have the drag_data_received, and
once
the operation is complete for the drag and drop, you can have it reset
the
reorderable property on the TreeView.
That would be the only way I could think of how to do it. But as I
said,
it’s been a while since I messed with Ruby/Gnome2.
Yes!!! I finally made it work! To do it, i made the parent window (a
scrolledwindow in my case) dnd sensitive and it receives the drop
notification and there’s no need to mess with the treeview itself.
It works but there’s one drawback: the tree view doesn’t scroll when
there are more entries that can fit in the view. It’s somewhat logical
since it’s the scroll window itself that is notified and not the tree
view.
It doesn’t matter in my use case but I guess it may be a cause of
concern in other cases.
I’ll try to work around this problem when I have time to do it.