#NEWLINE# def __init__( self , switchboard , master = None , chipwidth = _CHIPWIDTH , chipheight = _CHIPHEIGHT , numchips = _NUMCHIPS , generator = None , axis = None , label = '' , uwdvar = None , hexvar = None ) : #NEWLINE# #INDENT# self . __generator = generator #NEWLINE# self . __axis = axis #NEWLINE# self . __numchips = numchips #NEWLINE# assert ( self . __axis in ( 0 , 1 , 2 ) ) #NEWLINE# self . __uwd = uwdvar #NEWLINE# self . __hexp = hexvar #NEWLINE# self . __lastchip = None #NEWLINE# self . __sb = switchboard #NEWLINE# canvaswidth = ( numchips * ( chipwidth + 1 ) ) #NEWLINE# canvasheight = ( chipheight + 43 ) #NEWLINE# canvas = self . __canvas = Canvas ( master , width = canvaswidth , height = canvasheight ) #NEWLINE# canvas . pack ( ) #NEWLINE# canvas . bind ( '<ButtonPress-1>' , self . __select_chip ) #NEWLINE# canvas . bind ( '<ButtonRelease-1>' , self . __select_chip ) #NEWLINE# canvas . bind ( '<B1-Motion>' , self . __select_chip ) #NEWLINE# canvas . tk . eval ( TCLPROC ) #NEWLINE# chips = self . __chips = [ ] #NEWLINE# x = 1 #NEWLINE# y = 30 #NEWLINE# tags = ( 'chip' , ) #NEWLINE# for c in range ( self . __numchips ) : #NEWLINE# #INDENT# color = 'grey' #NEWLINE# canvas . create_rectangle ( x , y , ( x + chipwidth ) , ( y + chipheight ) , fill = color , outline = color , tags = tags ) #NEWLINE# x = ( ( x + chipwidth ) + 1 ) #NEWLINE# chips . append ( color ) #NEWLINE# #UNINDENT# self . __label = canvas . create_text ( 3 , ( ( y + chipheight ) + 8 ) , text = label , anchor = W ) #NEWLINE# chipx = self . __arrow_x ( 0 ) #NEWLINE# self . __leftarrow = LeftArrow ( canvas , chipx ) #NEWLINE# chipx = self . __arrow_x ( ( len ( chips ) - 1 ) ) #NEWLINE# self . __rightarrow = RightArrow ( canvas , chipx )