<s> from traits . api import Bool , HasTraits , Property , Str <EOL> from traitsui . api import Item , View <EOL> from traitsui . api import TextEditor <EOL> class Person ( HasTraits ) : <EOL> name = Str <EOL> invalid = Property ( Bool , depends_on = '<STR_LIT:name>' ) <EOL> def _get_invalid ( self ) : <EOL> stripped_name = self . name . strip ( ) <EOL> return stripped_name == '<STR_LIT>' <EOL> traits_view = View ( <EOL> Item ( '<STR_LIT:name>' , editor = TextEditor ( invalid = '<STR_LIT>' ) ) , <EOL> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> Person ( ) . configure_traits ( ) </s>
