#NEWLINE# def main( self , name = 'world' ) : #NEWLINE# #INDENT# self . wid = gui . Widget ( ) #NEWLINE# self . wid . set_size ( 400 , 300 ) #NEWLINE# self . wid . style [ 'text-align' ] = 'center' #NEWLINE# self . title_label = gui . Label ( 'Dynamical layout change demo' ) #NEWLINE# self . title_label . set_size ( 350 , 20 ) #NEWLINE# self . description_label = gui . Label ( 'Choose from the dropdown a widget and it will be added to the interface.\n                                           If you change the dropdown selection it will substitute it.' ) #NEWLINE# self . description_label . set_size ( 350 , 80 ) #NEWLINE# self . dropdown = gui . DropDown ( ) #NEWLINE# self . dropdown . set_size ( 200 , 20 ) #NEWLINE# choose_ddi = gui . DropDownItem ( 'Choose...' ) #NEWLINE# button_ddi = gui . DropDownItem ( 'Add button' ) #NEWLINE# label_ddi = gui . DropDownItem ( 'Add label' ) #NEWLINE# self . dropdown . append ( choose_ddi ) #NEWLINE# self . dropdown . append ( button_ddi ) #NEWLINE# self . dropdown . append ( self ) #NEWLINE# self . dropdown . set_on_change_listener ( self , 'on_dropdown_change' ) #NEWLINE# self . wid . append ( self . title_label ) #NEWLINE# self . wid . append ( self . description_label ) #NEWLINE# self . wid . append ( self . dropdown ) #NEWLINE# return self . wid