Class Tk::BLT::Treeview
In: tk/lib/tkextlib/blt/treeview.rb
Parent: TkWindow

Methods

__destroy_hook__   __item_validation_class_list   __validation_class_list   _find_exec_flag_value   bbox   button_activate   button_bind   button_bind_append   button_bind_remove   button_bindinfo   close   close_recurse   column_activate   column_delete   column_insert   column_invoke   column_move   column_names   column_nearest   curselection   delete   entry_activate   entry_before?   entry_children   entry_delete   entry_hidden?   entry_open?   entry_size   entry_size_recurse   find   get   get_full   hide   index   index_at   index_at_path   insert   insert_at   move_after   move_before   move_into   nearest   open   open_recurse   range   range_open   scan_dragto   scan_mark   screen_bbox   see   see_anchor   selection_anchor   selection_cancel   selection_clear   selection_clear_all   selection_include?   selection_mark   selection_present?   selection_set   selection_toggle   show   sort_auto   sort_auto=   sort_auto?   sort_once   sort_once_recurse   tag_add   tag_bind   tag_bind_append   tag_bind_remove   tag_bindinfo   tag_delete   tag_focus   tag_forget   tag_names   tag_nodes   tagid2obj   text_apply   text_cancel   text_delete   text_get   text_get_root   text_icursor   text_index   text_insert   text_selection_adjust   text_selection_clear   text_selection_from   text_selection_present   text_selection_range   text_selection_to   toggle  

Included Modules

Scrollable ValidateConfigure ItemValidateConfigure Tk::BLT::Treeview::ConfigMethod

Classes and Modules

Module Tk::BLT::Treeview::ConfigMethod
Module Tk::BLT::Treeview::TagOrID_Methods
Class Tk::BLT::Treeview::FindExecFlagValue
Class Tk::BLT::Treeview::Node
Class Tk::BLT::Treeview::OpenCloseCommand
Class Tk::BLT::Treeview::Tag

Constants

TkCommandNames = ['::blt::treeview'.freeze].freeze
WidgetClassName = 'TreeView'.freeze

Public Instance methods

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 275
  def __destroy_hook__
    Tk::BLT::Treeview::Node::TreeNodeID_TBL.delete(@path)
    Tk::BLT::Treeview::Tag::TreeTagID_TBL.delete(@path)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 262
  def __item_validation_class_list(id)
    case id
    when 'entry'
      super(id) << OpenCloseCommand
    else
      super(id)
    end
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 254
  def __validation_class_list
    super() << OpenCloseCommand
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 487
  def _find_exec_flag_value(val)
    if val.kind_of?(Array)
      cmd, *args = val
      FindExecFlagValue.new(cmd, args.join(' '))
    elsif TkComm._callback_entry?(val)
      FindExecFlagValue.new(val)
    else
      val
    end
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 304
  def bbox(*tags)
    list(tk_send('bbox', *(tags.collect{|tag| tagid(tag)})))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 338
  def button_activate(tag)
    tk_send('button', 'activate', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 343
  def button_bind(tag, seq, *args)
    if TkComm._callback_entry?(args[0]) || !block_given?
      cmd = args.shift
    else
      cmd = Proc.new
    end
    _bind([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 352
  def button_bind_append(tag, seq, *args)
    if TkComm._callback_entry?(args[0]) || !block_given?
      cmd = args.shift
    else
      cmd = Proc.new
    end
    _bind_append([@path, 'button', 'bind', tagid(tag)], seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 361
  def button_bind_remove(tag, seq)
    _bind_remove([@path, 'button', 'bind', tagid(tag)], seq)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 365
  def button_bindinfo(tag, seq=nil)
    _bindinfo([@path, 'button', 'bind', tagid(tag)], seq)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 369
  def close(*tags)
    tk_send('close', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 373
  def close_recurse(*tags)
    tk_send('close', '-recurse', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 378
  def column_activate(column=None)
    if column == None
      tk_send('column', 'activate')
    else
      tk_send('column', 'activate', column)
      self
    end
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 387
  def column_delete(*fields)
    tk_send('column', 'delete', *fields)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 391
  def column_insert(pos, field, *opts)
    tk_send('column', 'insert', pos, field, *opts)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 395
  def column_invoke(field)
    tk_send('column', 'invoke', field)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 399
  def column_move(name, dest)
    tk_send('column', 'move', name, dest)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 403
  def column_names()
    simplelist(tk_send('column', 'names'))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 406
  def column_nearest(x, y=None)
    tk_send('column', 'nearest', x, y)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 410
  def curselection
    simplelist(tk_send('curselection')).collect{|id| tagid2obj(id)}
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 414
  def delete(*tags)
    tk_send('delete', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 419
  def entry_activate(tag)
    tk_send('entry', 'activate', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 430
  def entry_before?(tag1, tag2)
    bool(tk_send('entry', 'isbefore', tagid(tag1), tagid(tag2)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 423
  def entry_children(tag, first=None, last=None)
    simplelist(tk_send('entry', 'children', tagid(tag), 
                       first, last)).collect{|id| tagid2obj(id)}
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 427
  def entry_delete(tag, first=None, last=None)
    tk_send('entry', 'delete', tagid(tag), first, last)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 433
  def entry_hidden?(tag)
    bool(tk_send('entry', 'ishidden', tagid(tag)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 436
  def entry_open?(tag)
    bool(tk_send('entry', 'isopen', tagid(tag)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 440
  def entry_size(tag)
    number(tk_send('entry', 'size', tagid(tag)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 443
  def entry_size_recurse(tag)
    number(tk_send('entry', 'size', '-recurse', tagid(tag)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 500
  def find(first, last, keys={})
    keys = _search_flags(keys)
    keys['exec'] = _find_exec_flag_value(keys['exec']) if keys.key?('exec')
    args = hash_kv(keys) << '--' << tagid(first) << tagid(last)
    simplelist(tk_send('find', *args)).collect{|id| tagid2obj(id)}
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 511
  def get(*tags)
    simplelist(tk_send('get', *(tags.collect{|tag| tagid(tag)})))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 514
  def get_full(*tags)
    simplelist(tk_send('get', '-full', *(tags.collect{|tag| tagid(tag)})))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 518
  def hide(*tags)
    if tags[-1].kind_of?(Hash)
      keys = tags.pop
    else
      keys = {}
    end
    keys = _search_flags(keys)
    args = hash_kv(keys) << '--'
    args.concat(tags.collect{|t| tagid(t)})
    tk_send('hide', *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 531
  def index(str)
    tagid2obj(tk_send('index', str))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 534
  def index_at(tag, str)
    tagid2obj(tk_send('index', '-at', tagid(tag), str))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 537
  def index_at_path(tag, str)
    tagid2obj(tk_send('index', '-at', tagid(tag), '-path', str))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 541
  def insert(pos, parent=nil, keys={})
    Tk::BLT::Treeview::Node.new(pos, parent, keys)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 544
  def insert_at(tag, pos, parent=nil, keys={})
    if parent.kind_of?(Hash)
      keys = parent
      parent = nil
    end

    keys = _symbolkey2str(keys)
    keys['at'] = tagid(tag)

    Tk::BLT::Treeview::Node.new(pos, parent, keys)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 560
  def move_after(tag, dest)
    tk_send('move', tagid(tag), 'after', tagid(dest))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 556
  def move_before(tag, dest)
    tk_send('move', tagid(tag), 'before', tagid(dest))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 564
  def move_into(tag, dest)
    tk_send('move', tagid(tag), 'into', tagid(dest))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 569
  def nearest(x, y, var=None)
    tagid2obj(tk_send('nearest', x, y, var))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 573
  def open(*tags)
    tk_send('open', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 577
  def open_recurse(*tags)
    tk_send('open', '-recurse', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 582
  def range(first, last)
    simplelist(tk_send('range', tagid(first), tagid(last))).collect{|id|
      tagid2obj(id)
    }
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 587
  def range_open(first, last)
    simplelist(tk_send('range', '-open', 
                       tagid(first), tagid(last))).collect{|id|
      tagid2obj(id)
    }
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 598
  def scan_dragto(x, y)
    tk_send_without_enc('scan', 'dragto', x, y)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 594
  def scan_mark(x, y)
    tk_send_without_enc('scan', 'mark', x, y)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 308
  def screen_bbox(*tags)
    list(tk_send('bbox', '-screen', *(tags.collect{|tag| tagid(tag)})))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 603
  def see(tag)
    tk_send_without_enc('see', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 607
  def see_anchor(anchor, tag)
    tk_send_without_enc('see', '-anchor', anchor, tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 612
  def selection_anchor(tag)
    tk_send_without_enc('selection', 'anchor', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 616
  def selection_cancel()
    tk_send_without_enc('selection', 'cancel')
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 620
  def selection_clear(first, last=None)
    tk_send_without_enc('selection', 'clear', tagid(first), tagid(last))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 624
  def selection_clear_all()
    tk_send_without_enc('selection', 'clearall')
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 632
  def selection_include?(tag)
    bool(tk_send('selection', 'include', tagid(tag)))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 628
  def selection_mark(tag)
    tk_send_without_enc('selection', 'mark', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 635
  def selection_present?()
    bool(tk_send('selection', 'present'))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 638
  def selection_set(first, last=None)
    tk_send_without_enc('selection', 'set', tagid(first), tagid(last))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 642
  def selection_toggle(first, last=None)
    tk_send_without_enc('selection', 'toggle', tagid(first), tagid(last))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 647
  def show(*tags)
    if tags[-1].kind_of?(Hash)
      keys = tags.pop
    else
      keys = {}
    end
    keys = _search_flags(keys)
    args = hash_kv(keys) << '--'
    args.concat(tags.collect{|t| tagid(t)})
    tk_send('show', *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 660
  def sort_auto(mode)
    tk_send('sort', 'auto', mode)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 664
  def sort_auto=(mode)
    tk_send('sort', 'auto', mode)
    mode
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 668
  def sort_auto?
    bool(tk_send('sort', 'auto'))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 671
  def sort_once(*tags)
    tk_send('sort', 'once', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 675
  def sort_once_recurse(*tags)
    tk_send('sort', 'once', '-recurse', *(tags.collect{|tag| tagid(tag)}))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 680
  def tag_add(tag, *ids)
    tk_send('tag', 'add', tagid(tag), *ids)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 312
  def tag_bind(tag, seq, *args)
    if TkComm._callback_entry?(args[0]) || !block_given?
      cmd = args.shift
    else
      cmd = Proc.new
    end
    _bind([@path, 'bind', tagid(tag)], seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 321
  def tag_bind_append(tag, seq, *args)
    if TkComm._callback_entry?(args[0]) || !block_given?
      cmd = args.shift
    else
      cmd = Proc.new
    end
    _bind_append([@path, 'bind', tagid(tag)], seq, cmd, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 330
  def tag_bind_remove(tag, seq)
    _bind_remove([@path, 'bind', tagid(tag)], seq)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 334
  def tag_bindinfo(tag, seq=nil)
    _bindinfo([@path, 'bind', tagid(tag)], seq)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 684
  def tag_delete(tag, *ids)
    tk_send('tag', 'delete', tagid(tag), *ids)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 507
  def tag_focus(tag)
    tk_send('focus', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 688
  def tag_forget(tag)
    tk_send('tag', 'forget', tagid(tag))
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 692
  def tag_names(id=nil)
    id = (id)? tagid(id): None

    simplelist(tk_send('tag', 'nodes', id)).collect{|tag|
      Tk::BLT::Treeview::Tag.id2obj(self, tag)
    }
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 699
  def tag_nodes(tag)
    simplelist(tk_send('tag', 'nodes', tagid(tag))).collect{|id|
      Tk::BLT::Treeview::Node.id2obj(self, id)
    }
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 290
  def tagid2obj(tagid)
    if tagid.kind_of?(Integer)
      Tk::BLT::Treeview::Node.id2obj(self, tagid.to_s)
    elsif tagid.kind_of?(String)
      if tagid =~ /^\d+$/
        Tk::BLT::Treeview::Node.id2obj(self, tagid)
      else
        Tk::BLT::Treeview::Tag.id2obj(self, tagid)
      end
    else
      tagid
    end
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 705
  def text_apply
    tk_send('text', 'apply')
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 709
  def text_cancel
    tk_send('text', 'cancel')
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 714
  def text_delete(first, last)
    tk_send('text', 'delete', first, last)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 718
  def text_get(x, y)
    tk_send('text', 'get', x, y)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 721
  def text_get_root(x, y)
    tk_send('text', 'get', '-root', x, y)
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 724
  def text_icursor(idx)
    tk_send('text', 'icursor', idx)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 728
  def text_index(idx)
    num_or_str(tk_send('text', 'index', idx))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 731
  def text_insert(idx, str)
    tk_send('text', 'insert', idx, str)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 736
  def text_selection_adjust(idx)
    tk_send('text', 'selection', 'adjust', idx)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 740
  def text_selection_clear
    tk_send('text', 'selection', 'clear')
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 744
  def text_selection_from(idx)
    tk_send('text', 'selection', 'from', idx)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 748
  def text_selection_present
    num_or_str(tk_send('text', 'selection', 'present'))
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 751
  def text_selection_range(start, last)
    tk_send('text', 'selection', 'range', start, last)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 755
  def text_selection_to(idx)
    tk_send('text', 'selection', 'to', idx)
    self
  end

[Source]

# File tk/lib/tkextlib/blt/treeview.rb, line 760
  def toggle(tag)
    tk_send('toggle', tagid(tag))
    self
  end

[Validate]