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

Method bind

Lib/idlelib/multicall.py:213–229  ·  view source on GitHub ↗
(self, triplet, func)

Source from the content-addressed store, hash-verified

211 seq, handler)))
212
213 def bind(self, triplet, func):
214 if triplet[2] not in self.bindedfuncs:
215 self.bindedfuncs[triplet[2]] = [[] for s in _states]
216 for s in _states:
217 lists = [ self.bindedfuncs[detail][i]
218 for detail in (triplet[2], None)
219 for i in _state_subsets[s] ]
220 handler = self.__create_handler(lists, self.type,
221 _state_codes[s])
222 seq = "<%s%s-%s>"% (_state_names[s], self.typename, triplet[2])
223 self.handlerids.append((seq, self.widget.bind(self.widgetinst,
224 seq, handler)))
225 doit = lambda: self.bindedfuncs[triplet[2]][triplet[0]].append(func)
226 if not self.ishandlerrunning:
227 doit()
228 else:
229 self.doafterhandler.append(doit)
230
231 def unbind(self, triplet, func):
232 doit = lambda: self.bindedfuncs[triplet[2]][triplet[0]].remove(func)

Callers

nothing calls this directly

Calls 4

__create_handlerMethod · 0.95
doitFunction · 0.50
appendMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected