#NEWLINE# def setSurfaces( self , normalSurface , downSurface = None , highlightSurface = None ) : #NEWLINE# #INDENT# 'Switch the button to a custom image type of button (rather than a\n        text button). You can specify either a pygame.Surface object or a\n        string of a filename to load for each of the three button appearance\n        states.' #NEWLINE# if ( downSurface is None ) : #NEWLINE# #INDENT# downSurface = normalSurface #NEWLINE# #UNINDENT# if ( highlightSurface is None ) : #NEWLINE# #INDENT# highlightSurface = normalSurface #NEWLINE# #UNINDENT# if ( type ( normalSurface ) == str ) : #NEWLINE# #INDENT# self . origSurfaceNormal = pygame . image . load ( normalSurface ) #NEWLINE# #UNINDENT# if ( type ( downSurface ) == str ) : #NEWLINE# #INDENT# self . origSurfaceDown = pygame . image . load ( downSurface ) #NEWLINE# #UNINDENT# if ( type ( highlightSurface ) == str ) : #NEWLINE# #INDENT# self . origSurfaceHighlight = pygame . image . load ( highlightSurface ) #NEWLINE# #UNINDENT# if ( self . origSurfaceNormal . get_size ( ) != self . origSurfaceDown . get_size ( ) != self . origSurfaceHighlight . get_size ( ) ) : #NEWLINE# #INDENT# raise Exception ( 'foo' ) #NEWLINE# #UNINDENT# self . surfaceNormal = self . origSurfaceNormal #NEWLINE# self . surfaceDown = self . origSurfaceDown #NEWLINE# self . surfaceHighlight = self . origSurfaceHighlight #NEWLINE# self . customSurfaces = True #NEWLINE# self . _rect = pygame . Rect ( ( self . _rect . left , self . _rect . top , self . surfaceNormal . get_width ( ) , self . surfaceNormal . get_height ( ) ) )