Lines Matching refs:event
10 To enable an object to be dragged, you must create an event binding
13 should call Tkdnd.dnd_start(source, event), where 'source' is the
14 object to be dragged, and 'event' is the event that invoked the call
35 function is called as dnd_accept(source, event), where 'source' is the
37 'event' is the most recent event object (generally a <Motion> event;
50 source object, and 'event' is the most recent event object):
55 dnd_motion(source, event) is called.
58 None. The new target object's method dnd_enter(source, event) is
62 None. The old target object's method dnd_leave(source, event) is
66 target object's method dnd_leave(source, event), and then the new
67 target object's method dnd_enter(source, event) is called.
81 method dnd_commit(source, event).
84 object, its dnd_leave(source, event) method is called to complete the
88 is over, by a call to source.dnd_end(target, event), specifying either
109 def dnd_start(source, event):
110 h = DndHandler(source, event)
123 def __init__(self, source, event):
124 if event.num > 5:
126 root = event.widget._root()
135 self.initial_button = button = event.num
136 self.initial_widget = widget = event.widget
152 def on_motion(self, event):
153 x, y = event.x_root, event.y_root
163 new_target = attr(source, event)
170 old_target.dnd_motion(source, event)
174 old_target.dnd_leave(source, event)
176 new_target.dnd_enter(source, event)
179 def on_release(self, event):
180 self.finish(event, 1)
182 def cancel(self, event=None):
183 self.finish(event, 0)
185 def finish(self, event, commit=0):
198 target.dnd_commit(source, event)
200 target.dnd_leave(source, event)
202 source.dnd_end(target, event)
240 def press(self, event):
241 if dnd_start(self, event):
243 self.x_off = event.x
244 self.y_off = event.y
248 def move(self, event):
249 x, y = self.where(self.canvas, event)
255 def where(self, canvas, event):
260 x = event.x_root - x_org
261 y = event.y_root - y_org
265 def dnd_end(self, target, event):
277 def dnd_accept(self, source, event):
280 def dnd_enter(self, source, event):
282 x, y = source.where(self.canvas, event)
286 self.dnd_motion(source, event)
288 def dnd_motion(self, source, event):
289 x, y = source.where(self.canvas, event)
293 def dnd_leave(self, source, event):
298 def dnd_commit(self, source, event):
299 self.dnd_leave(source, event)
300 x, y = source.where(self.canvas, event)