--- Tkdnd_orig.py 2009-04-23 12:11:07.000000000 +0200 +++ Tkdnd.py 2009-04-23 12:19:18.000000000 +0200 @@ -105,8 +105,8 @@ # The factory function -def dnd_start(source, event): - h = DndHandler(source, event) +def dnd_start(source, event, dndcursor="hand2", swapcursoronclick=True): + h = DndHandler(source, event, dndcursor, swapcursoronclick) if h.root: return h else: @@ -119,7 +119,7 @@ root = None - def __init__(self, source, event): + def __init__(self, source, event, dndcursor, swapcursoronclick): if event.num > 5: return root = event.widget._root() @@ -137,7 +137,10 @@ self.save_cursor = widget['cursor'] or "" widget.bind(self.release_pattern, self.on_release) widget.bind("", self.on_motion) - widget['cursor'] = "hand2" + self._swapcursoronclick = swapcursoronclick + if swapcursoronclick and not dndcursor is None: + widget["cursor"] = dndcursor + self.dndcursor = dndcursor def __del__(self): root = self.root @@ -149,6 +152,10 @@ pass def on_motion(self, event): + if not self._swapcursoronclick: + if not self.dndcursor is None: + event.widget['cursor'] = self.dndcursor + self.dndcursor = None x, y = event.x_root, event.y_root target_widget = self.initial_widget.winfo_containing(x, y) source = self.source