#NEWLINE# def delegate_to_widget_mixin( attribute_name ) : #NEWLINE# #INDENT# '\n    Return a mixin class that delegates all standard widget methods\n    to an attribute given by attribute_name.\n\n    This mixin is designed to be used as a superclass of another widget.\n    ' #NEWLINE# get_delegate = attrgetter ( get_delegate ) #NEWLINE# class DelegateToWidgetMixin ( Widget ) : #NEWLINE# #INDENT# no_cache = [ 'rows' ] #NEWLINE# def render( self , size , focus = False ) : #NEWLINE# #INDENT# canv = get_delegate ( self ) . render ( size , focus = focus ) #NEWLINE# return CompositeCanvas ( canv ) #NEWLINE# #UNINDENT# selectable = property ( ( lambda self : get_delegate ( self ) . selectable ) ) #NEWLINE# get_cursor_coords = property ( ( lambda self : get_delegate ( self ) . get_cursor_coords ) ) #NEWLINE# get_pref_col = property ( ( lambda self : get_delegate ( self ) . get_pref_col ) ) #NEWLINE# keypress = property ( ( lambda self : get_delegate ( self ) . keypress ) ) #NEWLINE# move_cursor_to_coords = property ( ( lambda self : get_delegate ( self ) . move_cursor_to_coords ) ) #NEWLINE# rows = property ( ( lambda self : get_delegate ( self ) . rows ) ) #NEWLINE# mouse_event = property ( ( lambda self : get_delegate ( self ) . mouse_event ) ) #NEWLINE# sizing = property ( ( lambda self : get_delegate ( self ) . sizing ) ) #NEWLINE# pack = property ( ( lambda self : get_delegate ( self ) . pack ) ) #NEWLINE# #UNINDENT# return DelegateToWidgetMixin