#NEWLINE# def add( self , obj , tag = None , tagpfx = None , belowThis = None , redraw = True ) : #NEWLINE# #INDENT# self . count += 1 #NEWLINE# if tag : #NEWLINE# #INDENT# if ( tag in self . tags ) : #NEWLINE# #INDENT# raise CanvasError ( ( "Tag already used: '%s'" % tag ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if tagpfx : #NEWLINE# #INDENT# if tagpfx . startswith ( '@' ) : #NEWLINE# #INDENT# raise CanvasError ( "Tag prefix may not begin with '@'" ) #NEWLINE# #UNINDENT# tag = ( '%s%d' % ( tagpfx , self . count ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# tag = ( '@%d' % self . count ) #NEWLINE# #UNINDENT# #UNINDENT# obj . tag = tag #NEWLINE# self . tags [ tag ] = obj #NEWLINE# self . add_object ( obj , belowThis = belowThis ) #NEWLINE# if obj . has_callback ( 'modified' ) : #NEWLINE# #INDENT# obj . add_callback ( 'modified' , self . subcanvas_updated_cb ) #NEWLINE# #UNINDENT# if tag : #NEWLINE# #INDENT# self . update_canvas ( whence = 3 ) #NEWLINE# #UNINDENT# return tag