Hello,
I have a strange problem with Drag and Drop events. The problem is: if I
drag the item first time to Entry - my callback emits one time, but if I
drag item the second time - my callback emits 2 times. Why 2 times?

This is my example code:


import gtk
import time

TARGET_TYPE = 100

def my_callback(widget, context, x, y, selection, targetType, eventTime):
    print 'my callback'
    if targetType == TARGET_TYPE:
        print selection
        widget.set_text(str(time.time()))


window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.resize(400, 40)
window.connect('destroy', gtk.main_quit)
entry = gtk.Entry()
entry.connect('drag_data_received', my_callback)
entry.drag_dest_set(gtk.DEST_DEFAULT_ALL, [('text/uri-list', 0,
TARGET_TYPE)], gtk.gdk.ACTION_COPY)
window.add(entry)
window.show_all()
gtk.main()


Br, Max.
_______________________________________________
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