MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/tkinter/dnd.py:123–141  ·  view source on GitHub ↗
(self, source, event)

Source from the content-addressed store, hash-verified

121 root = None
122
123 def __init__(self, source, event):
124 if event.num > 5:
125 return
126 root = event.widget._root()
127 try:
128 root.__dnd
129 return # Don't start recursive dnd
130 except AttributeError:
131 root.__dnd = self
132 self.root = root
133 self.source = source
134 self.target = None
135 self.initial_button = button = event.num
136 self.initial_widget = widget = event.widget
137 self.release_pattern = "<B%d-ButtonRelease-%d>" % (button, button)
138 self.save_cursor = widget['cursor'] or ""
139 widget.bind(self.release_pattern, self.on_release)
140 widget.bind("<Motion>", self.on_motion)
141 widget['cursor'] = "hand2"
142
143 def __del__(self):
144 root = self.root

Callers

nothing calls this directly

Calls 2

_rootMethod · 0.80
bindMethod · 0.45

Tested by

no test coverage detected