changeset 735:d6cea108ec48

demo drag/drop receiver in curvecalc Ignore-this: a55db5fdd8872fc73f5dc57e5f48a47b
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 15 Jun 2012 06:10:29 +0000
parents d230824728aa
children d1bff8a3b069
files light9/curvecalc/curveview.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/light9/curvecalc/curveview.py	Fri Jun 15 06:09:49 2012 +0000
+++ b/light9/curvecalc/curveview.py	Fri Jun 15 06:10:29 2012 +0000
@@ -374,6 +374,17 @@
         self.widget.connect("focus-out-event", self.onFocusOut)
         #self.widget.connect("event", self.onAny)
 
+        # this is actually for subterms or mainwin, but i test here for reloads.
+        self.widget.drag_dest_set(flags=gtk.DEST_DEFAULT_ALL,
+                                  targets=[('text/uri-list', 0, 0)],
+                                  actions=gtk.gdk.ACTION_COPY)
+        self.widget.connect("drag-data-received", self.onDataReceived)
+
+
+    def onDataReceived(self, widget, context, x, y, selection, targetType, time):
+        print "recv", repr(selection.data)
+        
+
     def onAny(self, w, event):
         print "   %s on %s" % (event, w)