Class Tk::BWidget::Tree
In: tk/lib/tkextlib/bwidget/tree.rb
Parent: TkWindow

Methods

Included Modules

TkItemConfigMethod Scrollable

Classes and Modules

Class Tk::BWidget::Tree::Event_for_Items
Class Tk::BWidget::Tree::Node

Constants

TkCommandNames = ['Tree'.freeze].freeze
WidgetClassName = 'Tree'.freeze

Public Instance methods

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 82
  def close_tree(node, recurse=None)
    tk_send('closetree', tagid(node), recurse)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 87
  def delete(*args)
    tk_send('delete', *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 92
  def edit(node, text, *args)
    tk_send('edit', tagid(node), text, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 97
  def exist?(node)
    bool(tk_send('exists', tagid(node)))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 115
  def get_node(node, idx)
    Tk::BWidget::Tree::Node.id2obj(self, tk_send('nodes', tagid(node), idx))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 44
  def imagebind(*args)
    _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 49
  def imagebind_append(*args)
    _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 54
  def imagebind_remove(*args)
    _bind_remove_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 59
  def imagebindinfo(*args)
    _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 101
  def index(node)
    num_or_str(tk_send('index', tagid(node)))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 105
  def insert(idx, parent, node, keys={})
    tk_send('insert', idx, tagid(parent), tagid(node), *hash_kv(keys))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 110
  def move(parent, node, idx)
    tk_send('move', tagid(parent), tagid(node), idx)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 119
  def nodes(node, first=None, last=None)
    simplelist(tk_send('nodes', tagid(node), first, last)).collect{|node|
      Tk::BWidget::Tree::Node.id2obj(self, node)
    }
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 125
  def open?(node)
    bool(@tree.itemcget(tagid(node), 'open'))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 129
  def open_tree(node, recurse=None)
    tk_send('opentree', tagid(node), recurse)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 134
  def parent(node)
    Tk::BWidget::Tree::Node.id2obj(self, tk_send('parent', tagid(node)))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 138
  def reorder(node, neworder)
    tk_send('reorder', tagid(node), neworder)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 143
  def see(node)
    tk_send('see', tagid(node))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 148
  def selection_add(*args)
    tk_send_without_enc('selection', 'add', 
                        *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 154
  def selection_clear
    tk_send_without_enc('selection', 'clear')
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 159
  def selection_get
    list(tk_send_without_enc('selection', 'get'))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 163
  def selection_include?(*args)
    bool(tk_send_without_enc('selection', 'get', 
                             *(args.collect{|node| tagid(node)})))
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 168
  def selection_range(*args)
    tk_send_without_enc('selection', 'range', 
                        *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 174
  def selection_remove(*args)
    tk_send_without_enc('selection', 'remove', 
                        *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 180
  def selection_set(*args)
    tk_send_without_enc('selection', 'set', 
                        *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 186
  def selection_toggle(*args)
    tk_send_without_enc('selection', 'toggle', 
                        *(args.collect{|node| tagid(node)}))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 35
  def tagid(tag)
    if tag.kind_of?(Tk::BWidget::Tree::Node)
      tag.id
    else
      # tag

      _get_eval_string(tag)
    end
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 63
  def textbind(*args)
    _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 68
  def textbind_append(*args)
    _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 73
  def textbind_remove(*args)
    _bind_remove_for_event_class(Event_for_Items, [path, 'bindText'], *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 78
  def textbindinfo(*args)
    _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args)
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 192
  def toggle(node)
    tk_send_without_enc('toggle', tagid(node))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/tree.rb, line 197
  def visible(node)
    bool(tk_send_without_enc('visible', tagid(node)))
  end

[Validate]