On Sat, 2009-03-14 at 03:20 -0500, alex goretoy wrote:

> I would track certain evens and recreate the tree view with the list
> after drop or after press, code is good
> -Alex Goretoy
> http://www.goretoy.com


The problem is if I do this:


                self.maps_treeview.drag_source_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                self.maps_treeview.drag_dest_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                
self.maps_treeview.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
[("Reorder", gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)
                #self.maps_treeview.enable_model_drag_dest([("Reorder",
gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)


I can drag and drop from Nautilis, and add the files to the liststore
model. But I can't drag and drop within the tree view to reorder lines
because the enable_model_drag_dest() is commented out.

If I uncomment that last line, then I can't drag and drop files from
nautilus onto the treeview.

Now for  the interesting bit.  I thought I had it working, and in a way
I did.  

If I comment out the third line like so:

                self.maps_treeview.drag_source_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                self.maps_treeview.drag_dest_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                
#self.maps_treeview.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
[("Reorder", gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)
                self.maps_treeview.enable_model_drag_dest([("Reorder",
gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)

It  also fails to accept drag and drop from nautilus, but if I uncomment
the line and miss spell the widget like so:

                self.maps_treeview.drag_source_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                self.maps_treeview.drag_dest_set(gtk.DEST_DEFAULT_ALL,
target[:-1],gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
                NO_SUCH_WIDGET = None
                NO_SUCH_WIDGET.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
[("Reorder", gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)
                self.maps_treeview.enable_model_drag_dest([("Reorder",
gtk.TARGET_SAME_WIDGET, 0)], gtk.gdk.ACTION_COPY)

I can drag and drop from nautilus, and drag and drop to reorder the
lines, but obviously that is not the correct solution.  And just for
fun, if I comment out the NO_SUCH_WIDGET.enable_model_drag_source() line
once again I can't drag and drop from nautilus.

I am using python and pygtk as standard on ubuntu 8.10

Any ideas?


-- 
Rob Brown-Bayliss <[email protected]>
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to