pygtk dnd woes

johnthawk at excite.com johnthawk at excite.com
Sat Jan 12 22:14:57 EST 2008


Hi all,

DND has just about got me going bonkers.
I want to process the dnd drop to main window and then process the 
dnd_list to ship to open_arg. Resulting in individual editor panes 
opening the files.

The problem:
TypeError: dnd_drop() takes exactly 6 arguments (8 given) or
TypeError: dnd_drop() takes exactly 8 arguments (6 given)

Seems I'm in a catch 22 here.  The code:

      # read notes
      self.on_read_notes()
      # dnd 
#
      self.TARGET_TYPE_URI_LIST = 80
      self.window.dnd_list = [ ( 'text/plain', 0, self.TARGET_TYPE_URI_LIST ) ]
      self.window.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT,
	   self.window.dnd_list, gtk.gdk.ACTION_COPY)
      self.window.connect('drag_data_received', self.dnd_drop)
      self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL,
        [ ( 'text/uri-list', 0, self.TARGET_TYPE_URI_LIST ) ],
        gtk.gdk.ACTION_COPY)
      self.window.connect('drag_drop', self.dnd_drop)
#
      # show all
      self.window.show_all()
      self.window.set_title('GEd:')
      self.window.show()
      # welcome
      self.set_status('Welcome to GEd-V-0.1 :-) ...') 
#
   #--------------------------------------------------------------------------      
   def dnd_drop(self, widget, context, x, y, times):
        #                (self, widget, context, x, y, selection, target_type, time):
        # process list and and ship to open_arg
        print 'data received'
        context.finish(True, False, time)
        return True
# 
   #--------------------------------------------------------------------------
   def on_blank(self, widget):
      pass  

Thanks
john




_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!





More information about the Python-list mailing list