コード例 #1
0
    def set_validator(self, validator):
        """ Set the validator for the underlying widget.

        """
        if validator is None:
            self._validator = null_validator
            self._validator_message = ''
        else:
            self._validator = make_validator(validator)
            self._validator_message = validator.get('message', '')
コード例 #2
0
ファイル: wx_field.py プロジェクト: xiaowenlong100/enaml
    def set_validator(self, validator):
        """ Sets the validator for the control.

        """
        if validator is None:
            self._validator = null_validator
            self._validator_message = ''
        else:
            self._validator = make_validator(validator)
            self._validator_message = validator.get('message', '')