Class: TkValidateCommand

Class | TkValidateCommand
In: | tk/lib/tk/validation.rb
Parent: | Object

### Methods

_config_keys _initialize_for_cb_class new to_eval

### Included Modules

TkComm

### Classes and Modules

Class TkValidateCommand::ValidateArgs

### Public Class methods

_config_keys()

[Source]

    # File tk/lib/tk/validation.rb, line 271
      def self._config_keys
        # array of config-option key (string or symbol)
        ['vcmd', 'validatecommand', 'invcmd', 'invalidcommand']
      end

new(cmd = Proc.new, *args)

[Source]

    # File tk/lib/tk/validation.rb, line 313
      def initialize(cmd = Proc.new, *args)
        _initialize_for_cb_class(self.class::ValidateArgs, cmd, *args)
      end

### Public Instance methods

_initialize_for_cb_class(klass, cmd = Proc.new, *args)

[Source]

    # File tk/lib/tk/validation.rb, line 276
      def _initialize_for_cb_class(klass, cmd = Proc.new, *args)
        extra_args_tbl = klass._get_extra_args_tbl

        if args.compact.size > 0
          args = args.join(' ')
          keys = klass._get_subst_key(args)
          if cmd.kind_of?(String)
            id = cmd
          elsif cmd.kind_of?(TkCallbackEntry)
            @id = install_cmd(cmd)
          else
            @id = install_cmd(proc{|*arg|
                 ex_args = []
                 extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
                 klass.ret_val(cmd.call(
                   *(ex_args.concat(klass.scan_args(keys, arg)))
                 ))
            }) + ' ' + args
          end
        else
          keys, args = klass._get_all_subst_keys
          if cmd.kind_of?(String)
            id = cmd
          elsif cmd.kind_of?(TkCallbackEntry)
            @id = install_cmd(cmd)
          else
            @id = install_cmd(proc{|*arg|
                 ex_args = []
                 extra_args_tbl.reverse_each{|conv| ex_args << conv.call(arg.pop)}
                 klass.ret_val(cmd.call(
                   *(ex_args << klass.new(*klass.scan_args(keys, arg)))
                 ))
            }) + ' ' + args
          end
        end
      end

to_eval()

[Source]

    # File tk/lib/tk/validation.rb, line 317
      def to_eval
        @id
      end

[Validate]