Class | TkEntry
In: | tk/lib/tk/entry.rb
Parent: | TkLabel

### Methods

[] []= bbox cursor cursor= delete dragto get icursor icursor= index insert invoke_validate mark selection_adjust selection_clear selection_from selection_present selection_range selection_to set validate value value=

### Included Modules

X_Scrollable TkValidation

### Constants

TkCommandNames | = | ['entry'.freeze].freeze
WidgetClassName | = | 'Entry'.freeze

### Public Instance methods

[](*args)

[Source]

    # File tk/lib/tk/entry.rb, line 107
      def [](*args)
        self.value[*args]
      end

[]=(*args)

[Source]

    # File tk/lib/tk/entry.rb, line 110
      def []=(*args)
        val = args.pop
        str = self.value
        str[*args] = val
        self.value = str
        val
      end

bbox(index)

[Source]

    # File tk/lib/tk/entry.rb, line 29
      def bbox(index)
        list(tk_send_without_enc('bbox', index))
      end

cursor()

[Source]

    # File tk/lib/tk/entry.rb, line 32
      def cursor
        number(tk_send_without_enc('index', 'insert'))
      end

cursor=(index)

[Source]

    # File tk/lib/tk/entry.rb, line 36
      def cursor=(index)
        tk_send_without_enc('icursor', index)
        #self
        index
      end

delete(first, last=None)

[Source]

    # File tk/lib/tk/entry.rb, line 49
      def delete(first, last=None)
        tk_send_without_enc('delete', first, last)
        self
      end

dragto(pos)

[Source]

    # File tk/lib/tk/entry.rb, line 57
      def dragto(pos)
        tk_send_without_enc('scan', 'dragto', pos)
        self
      end

get()

Alias for value

icursor()

Alias for cursor

icursor=(index)

Alias for cursor=

index(idx)

[Source]

    # File tk/lib/tk/entry.rb, line 42
      def index(idx)
        number(tk_send_without_enc('index', idx))
      end

insert(pos,text)

[Source]

    # File tk/lib/tk/entry.rb, line 45
      def insert(pos,text)
        tk_send_without_enc('insert', pos, _get_eval_enc_str(text))
        self
      end

invoke_validate()

[Source]

    # File tk/lib/tk/entry.rb, line 85
      def invoke_validate
        bool(tk_send_without_enc('validate'))
      end

mark(pos)

[Source]

    # File tk/lib/tk/entry.rb, line 53
      def mark(pos)
        tk_send_without_enc('scan', 'mark', pos)
        self
      end

selection_adjust(index)

[Source]

    # File tk/lib/tk/entry.rb, line 61
      def selection_adjust(index)
        tk_send_without_enc('selection', 'adjust', index)
        self
      end

selection_clear()

[Source]

    # File tk/lib/tk/entry.rb, line 65
      def selection_clear
        tk_send_without_enc('selection', 'clear')
        self
      end

selection_from(index)

[Source]

    # File tk/lib/tk/entry.rb, line 69
      def selection_from(index)
        tk_send_without_enc('selection', 'from', index)
        self
      end

selection_present()

[Source]

    # File tk/lib/tk/entry.rb, line 73
      def selection_present()
        bool(tk_send_without_enc('selection', 'present'))
      end

selection_range(s, e)

[Source]

    # File tk/lib/tk/entry.rb, line 76
      def selection_range(s, e)
        tk_send_without_enc('selection', 'range', s, e)
        self
      end

selection_to(index)

[Source]

    # File tk/lib/tk/entry.rb, line 80
      def selection_to(index)
        tk_send_without_enc('selection', 'to', index)
        self
      end

set(val)

Alias for value=

validate(mode = nil)

[Source]

    # File tk/lib/tk/entry.rb, line 88
      def validate(mode = nil)
        if mode
          configure 'validate', mode
        else
          invoke_validate
        end
      end

value()

[Source]

    # File tk/lib/tk/entry.rb, line 96
      def value
        _fromUTF8(tk_send_without_enc('get'))
      end

value=(val)

[Source]

    # File tk/lib/tk/entry.rb, line 99
      def value= (val)
        tk_send_without_enc('delete', 0, 'end')
        tk_send_without_enc('insert', 0, _get_eval_enc_str(val))
        val
      end

[Validate]