Class: Tk::BWidget::Tree

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

### Methods

close_tree delete edit exist? get_node imagebind imagebind_append imagebind_remove imagebindinfo index insert move nodes open? open_tree parent reorder see selection_add selection_clear selection_get selection_include? selection_range selection_remove selection_set selection_toggle tagid textbind textbind_append textbind_remove textbindinfo toggle visible

### 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

close_tree(node, recurse=None)

[Source]

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

delete(*args)

[Source]

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

edit(node, text, *args)

[Source]

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

exist?(node)

[Source]

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

get_node(node, idx)

[Source]

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

imagebind(context, *args)

def imagebind(*args)

      _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
      self

end

[Source]

    # File tk/lib/tkextlib/bwidget/tree.rb, line 64
      def imagebind(context, *args)
        #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
        if TkComm._callback_entry?(args[0]) || !block_given?
          cmd = args.shift
        else
          cmd = Proc.new
        end
        _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
                              context, cmd, *args)
        self
      end

imagebind_append(context, *args)

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 80
      def imagebind_append(context, *args)
        #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
        if TkComm._callback_entry?(args[0]) || !block_given?
          cmd = args.shift
        else
          cmd = Proc.new
        end
        _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
                                     context, cmd, *args)
        self
      end

imagebind_remove(*args)

[Source]

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

imagebindinfo(*args)

[Source]

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

index(node)

[Source]

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

insert(idx, parent, node, keys={})

[Source]

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

move(parent, node, idx)

[Source]

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

nodes(node, first=None, last=None)

[Source]

    # File tk/lib/tkextlib/bwidget/tree.rb, line 179
      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

open?(node)

[Source]

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

open_tree(node, recurse=None)

[Source]

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

parent(node)

[Source]

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

reorder(node, neworder)

[Source]

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

see(node)

[Source]

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

selection_add(*args)

[Source]

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

selection_clear()

[Source]

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

selection_get()

[Source]

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

selection_include?(*args)

[Source]

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

selection_range(*args)

[Source]

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

selection_remove(*args)

[Source]

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

selection_set(*args)

[Source]

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

selection_toggle(*args)

[Source]

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

tagid(tag)

[Source]

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

textbind(context, *args)

def textbind(*args)

      _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args)
      self

end

[Source]

    # File tk/lib/tkextlib/bwidget/tree.rb, line 105
      def textbind(context, *args)
        #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
        if TkComm._callback_entry?(args[0]) || !block_given?
          cmd = args.shift
        else
          cmd = Proc.new
        end
        _bind_for_event_class(Event_for_Items, [path, 'bindText'],
                              context, cmd, *args)
        self
      end

textbind_append(context, *args)

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 121
      def textbind_append(context, *args)
        #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
        if TkComm._callback_entry?(args[0]) || !block_given?
          cmd = args.shift
        else
          cmd = Proc.new
        end
        _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
                                     context, cmd, *args)
        self
      end

textbind_remove(*args)

[Source]

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

textbindinfo(*args)

[Source]

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

toggle(node)

[Source]

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

visible(node)

[Source]

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

[Validate]