Making a treeview reorderable AND drag/drop sensitive

Hi,

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.

Any idea or link or something else?

Thanks.

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.

hth,

Mario

On Sun, Mar 21, 2010 at 1:22 PM, Marc Madmac <

Thanks for your advise, i will give it a try!

Marc

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.

Easy but hard to find!

Thanks a lot, Mario.

Marc

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.

Thanks again.

Marc

Not a problem Marc,

I didn’t think about the ScrolledWindow setup myself. Well, at least
you
found the way.

On Tue, Mar 23, 2010 at 3:04 PM, Marc Madmac <