Logo Search packages:      
Sourcecode: uligo version File versions  Download package

def board1::Board::state (   self,
  s,
  f = None 
)

s in "normal", "disabled": accepting moves or not
    f the function to call if a move is entered 
    [More elegant solution might be to replace this by an overloaded bind method,
    for some event "Move"?!]  

Definition at line 356 of file board1.py.

00356                               :
        """ s in "normal", "disabled": accepting moves or not
            f the function to call if a move is entered 
            [More elegant solution might be to replace this by an overloaded bind method,
            for some event "Move"?!]  """

        if s == "normal":
            self.callOnMove = f
            self.bound1 = self.bind("<Button-1>", self.onMove)  
            self.boundm = self.bind("<Motion>", self.shadedStone)
            self.boundl = self.bind("<Leave>", self.delShadedStone)
        elif s == "disabled":
            self.delShadedStone()
            try:
                self.unbind("<Button-1>", self.bound1)
                self.unbind("<Motion>", self.boundm)
                self.unbind("<Leave>", self.boundl)
            except (TclError, AttributeError): pass                     # if board was already disabled, unbind will fail
            
    def onMove(self, event):


Generated by  Doxygen 1.6.0   Back to index