<s> """<STR_LIT>""" <EOL> from traits . api import HasTraits , Str , Range , Bool , Trait <EOL> from traitsui . api import Item , Group , View <EOL> class SampleClass ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> name = Str <EOL> occupation = Str <EOL> age = Range ( <NUM_LIT> , <NUM_LIT> ) <EOL> registered_voter = Bool <EOL> view = View ( '<STR_LIT:name>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class InstanceEditorDemo ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> sample_instance = Trait ( SampleClass ( ) ) <EOL> inst_group = Group ( Item ( '<STR_LIT>' , style = '<STR_LIT>' , label = '<STR_LIT>' ) , <EOL> Item ( '<STR_LIT:_>' ) , <EOL> Item ( '<STR_LIT>' , style = '<STR_LIT>' , label = '<STR_LIT>' ) , <EOL> Item ( '<STR_LIT:_>' ) , <EOL> Item ( '<STR_LIT>' , style = '<STR_LIT:text>' , label = '<STR_LIT>' ) , <EOL> Item ( '<STR_LIT:_>' ) , <EOL> Item ( '<STR_LIT>' , <EOL> style = '<STR_LIT>' , <EOL> label = '<STR_LIT>' ) ) <EOL> view1 = View ( inst_group , <EOL> title = '<STR_LIT>' , <EOL> buttons = [ '<STR_LIT:OK>' ] ) <EOL> popup = InstanceEditorDemo ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> popup . configure_traits ( ) </s>
