Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
idlelib.MultiCall._SimpleBinder Class Reference

List of all members.

Public Member Functions

def __init__
def bind
def unbind
def __del__

Public Attributes

 type
 sequence
 widget
 widgetinst
 bindedfuncs
 handlerid

Detailed Description

Definition at line 68 of file MultiCall.py.


Constructor & Destructor Documentation

def idlelib.MultiCall._SimpleBinder.__init__ (   self,
  type,
  widget,
  widgetinst 
)

Definition at line 69 of file MultiCall.py.

00069 
00070     def __init__(self, type, widget, widgetinst):
00071         self.type = type
00072         self.sequence = '<'+_types[type][0]+'>'
00073         self.widget = widget
00074         self.widgetinst = widgetinst
00075         self.bindedfuncs = []
00076         self.handlerid = None

Here is the caller graph for this function:

Definition at line 99 of file MultiCall.py.

00099 
00100     def __del__(self):
00101         if self.handlerid:
00102             self.widget.unbind(self.widgetinst, self.sequence, self.handlerid)
00103 
00104 # An int in range(1 << len(_modifiers)) represents a combination of modifiers
00105 # (if the least significent bit is on, _modifiers[0] is on, and so on).
00106 # _state_subsets gives for each combination of modifiers, or *state*,
00107 # a list of the states which are a subset of it. This list is ordered by the
# number of modifiers is the state - the most specific state comes first.

Member Function Documentation

def idlelib.MultiCall._SimpleBinder.bind (   self,
  triplet,
  func 
)

Definition at line 77 of file MultiCall.py.

00077 
00078     def bind(self, triplet, func):
00079         if not self.handlerid:
00080             def handler(event, l = self.bindedfuncs, mc_type = self.type):
00081                 event.mc_type = mc_type
00082                 wascalled = {}
00083                 for i in range(len(l)-1, -1, -1):
00084                     func = l[i]
00085                     if func not in wascalled:
00086                         wascalled[func] = True
00087                         r = func(event)
00088                         if r:
00089                             return r
00090             self.handlerid = self.widget.bind(self.widgetinst,
00091                                               self.sequence, handler)
00092         self.bindedfuncs.append(func)

Here is the caller graph for this function:

def idlelib.MultiCall._SimpleBinder.unbind (   self,
  triplet,
  func 
)

Definition at line 93 of file MultiCall.py.

00093 
00094     def unbind(self, triplet, func):
00095         self.bindedfuncs.remove(func)
00096         if not self.bindedfuncs:
00097             self.widget.unbind(self.widgetinst, self.sequence, self.handlerid)
00098             self.handlerid = None

Here is the caller graph for this function:


Member Data Documentation

Definition at line 74 of file MultiCall.py.

Definition at line 75 of file MultiCall.py.

Definition at line 71 of file MultiCall.py.

Definition at line 70 of file MultiCall.py.

Definition at line 72 of file MultiCall.py.

Definition at line 73 of file MultiCall.py.


The documentation for this class was generated from the following file: