[pygtk] Re: Stop a row in a TreeView from being draggable
lefebure at stud.ntnu.no
lefebure at stud.ntnu.no
Tue Jun 20 17:38:19 WST 2006
Quoting Alan Franzoni:
> If you want to stop *all rows* from being draggable, here's a quick
> hack:
>
> treeview.drag_source_unset()
> treeview.drag_dest_unset()
>
> Truly speaking, they can be dragged anyway, but they won't drop
> anywhere.
>
> If you wanted to prevent just some rows from being dragged... I don't
> know,
> maybe you could connect a callback to dynamically set/unset
> drag_source ,
> but I think there'll be a better way around that.
Thanx for the reply. I should have mentionned that I need some rows to
be draggable and some not.
I implemented the solution you suggested by connecting to the
"button-press-event" and then setting and unsetting the viewtree from
being draggable according to the element being clicked. This works
fine, although the question of why the solution suggested by the PyGTK
2.0 Reference Manual does not work remains open.
Thanks for the help.
acrl
More information about the pygtk
mailing list