[pygtk] Rewrite behaviour on signal 'button_press_event' in treeview

philopensource at hotmail.com philopensource at hotmail.com
Mon Sep 12 19:46:50 WST 2005

Thomas Mills Hinkle wrote:

>On 9/12/05, philopensource at hotmail.com <philopensource at hotmail.com> wrote:
>>I use button_press_event because my problem is due to drag & drop which
>>happen only with button press_event.
>>Have you ever tryied drag and drop several rows from a treeview?
>>I think you should be surprised on the result even if you use
>>set_mode(gtk.SELECTION_MULTIPLE) or
>I use multiple-selection dnd all the time -- it's a little
>counterintuitive, but if you hold down control to select the last item
>and then drag, it works (for me anyway).
>Of course if you click just once, then you lose your multiple
>selections, which is a bummer, but is the expected behavior of a click
>in multiple-selection-mode.
>btw, I'm using exactly the same setup you are -- multiple rows from
>one treeview to another. You're welcome to poke around my source for
>help if you want, though it's not the most beautiful stuff in the
>world. I have it set up to move the selection from on treeview to the
>next and such automagically (so that if you select A & B and move them
>from treeview 1 to treeview 2, they will be selected when they arrive
>in treeview 2).
>If you do want to poke at the source, the relevant bits have to do
>with slTree and pTree (the two trees you can dnd between). The
>following explains the interface that code is controlling:
Thanks a lot Tom.
What a good piece of news that multiple drag and drop is working.
I tryied it in my own code but something is missing bacause, only one 
line keep selected when i drag.
Thanks a lot for sharing your code for DnD treeviews.
Philippe Collet

More information about the pygtk mailing list