Class | Tk::Tile::Treeview
In: | tk/lib/tkextlib/tile/treeview.rb
Parent: | TkWindow

### Methods

children delete detach exist? focus_item get get_directory identify index insert instate move next parent prev see selection selection_add selection_get selection_remove selection_set selection_toggle set set_children state style tagid

### Included Modules

Tk::Tile::TileWidget Scrollable Tk::Tile::TreeviewConfig

### Constants

TkCommandNames | = | ['::ttk::treeview'.freeze].freeze
TkCommandNames | = | ['::treeview'.freeze].freeze
WidgetClassName | = | 'Treeview'.freeze

### Public Class methods

style(*args)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 149
      def self.style(*args)
        [self::WidgetClassName, *(args.map!{|a| _get_eval_string(a)})].join('.')
      end

### Public Instance methods

children(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 161
      def children(item)
        simplelist(tk_send_without_enc('children', item))
      end

delete(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 170
      def delete(*items)
        tk_send_without_enc('delete', array2tk_list(items.flatten, true))
        self
      end

detach(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 175
      def detach(*items)
        tk_send_without_enc('detach', array2tk_list(items.flatten, true))
        self
      end

exist?(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 180
      def exist?(item)
        bool(tk_send_without_enc('exists', _get_eval_enc_str(item)))
      end

focus_item(item = None)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 184
      def focus_item(item = None)
        tk_send('focus', item)
      end

get(item, col)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 273
      def get(item, col)
        tk_send('set', item, col)
      end

get_directory(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 262
      def get_directory(item)
        # tile-0.7+
        ret = []
        lst = simplelist(tk_send('set', item))
        until lst.empty?
          col = lst.shift
          val = lst.shift
          ret << [col, val]
        end
        ret
      end

identify(x, y)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 188
      def identify(x, y)
        ret = simplelist(tk_send('identify', x, y))
        case ret[0]
        when 'heading', 'separator', 'cell'
          ret[-1] = num_or_str(ret[-1])
        end
      end

index(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 196
      def index(item)
        number(tk_send('index', item))
      end

insert(parent, idx, keys={})

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 200
      def insert(parent, idx, keys={})
        keys = _symbolkey2str(keys)
        id = keys.delete('id')
        if id
          tk_send('insert', parent, idx, '-id', id, *hash_kv(keys))
        else
          tk_send('insert', parent, idx, *hash_kv(keys))
        end
        self
      end

instate(spec, cmd=Proc.new)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 211
      def instate(spec, cmd=Proc.new)
        tk_send('instate', spec, cmd)
      end

move(item, parent, idx)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 218
      def move(item, parent, idx)
        tk_send('move', item, parent, idx)
        self
      end

next(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 223
      def next(item)
        tk_send('next', item)
      end

parent(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 227
      def parent(item)
        tk_send('parent', item)
      end

prev(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 231
      def prev(item)
        tk_send('prev', item)
      end

see(item)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 235
      def see(item)
        tk_send('see', item)
        self
      end

selection()

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 240
      def selection
        simplelist(tk_send('selection'))
      end

selection_add(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 245
      def selection_add(*items)
        tk_send('selection', 'add', array2tk_list(items.flatten, true))
        self
      end

selection_get()

Alias for selection

selection_remove(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 249
      def selection_remove(*items)
        tk_send('selection', 'remove', array2tk_list(items.flatten, true))
        self
      end

selection_set(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 253
      def selection_set(*items)
        tk_send('selection', 'set', array2tk_list(items.flatten, true))
        self
      end

selection_toggle(*items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 257
      def selection_toggle(*items)
        tk_send('selection', 'toggle', array2tk_list(items.flatten, true))
        self
      end

set(item, col, value)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 276
      def set(item, col, value)
        tk_send('set', item, col, value)
        self
      end

set_children(item, *items)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 164
      def set_children(item, *items)
        tk_send_without_enc('children', item,
                            array2tk_list(items.flatten, true))
        self
      end

state(spec=None)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 214
      def state(spec=None)
        tk_send('state', spec)
      end

tagid(id)

[Source]

    # File tk/lib/tkextlib/tile/treeview.rb, line 153
      def tagid(id)
        if id.kind_of?(Array)
          [id[0], _get_eval_string(id[1])]
        else
          _get_eval_string(id)
        end
      end

[Validate]