class Tk::BWidget::Tree

Constants

TkCommandNames
WidgetClassName

Public Instance Methods

areabind(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 61
def areabind(context, *args, &block)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_for_event_class(Event_for_Items, [path, 'bindArea'],
                        context, cmd, *args)
  self
end
areabind_append(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 72
def areabind_append(context, *args, &block)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_append_for_event_class(Event_for_Items, [path, 'bindArea'],
                               context, cmd, *args)
  self
end
areabind_remove(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 83
def areabind_remove(*args)
  _bind_remove_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
  self
end
areabindinfo(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 88
def areabindinfo(*args)
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindArea'], *args)
end
close_tree(node, recurse=None) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 158
def close_tree(node, recurse=None)
  tk_send('closetree', tagid(node), recurse)
  self
end
delete(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 163
def delete(*args)
  tk_send('delete', *(args.collect{|node| tagid(node)}))
  self
end
edit(node, text, *args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 168
def edit(node, text, *args)
  tk_send('edit', tagid(node), text, *args)
  self
end
exist?(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 173
def exist?(node)
  bool(tk_send('exists', tagid(node)))
end
find(findinfo, confine=None) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 177
def find(findinfo, confine=None)
  Tk::BWidget::Tree::Node.id2obj(self, tk_send(findinfo, confine))
end
find_line(linenum) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 183
def find_line(linenum)
  self.find(linenum)
end
find_position(x, y, confine=None) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 180
def find_position(x, y, confine=None)
  self.find(_at(x,y), confine)
end
get_node(node, idx) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 205
def get_node(node, idx)
  Tk::BWidget::Tree::Node.id2obj(self, tk_send('nodes', tagid(node), idx))
end
imagebind(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 92
def imagebind(context, *args, &block)
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_for_event_class(Event_for_Items, [path, 'bindImage'],
                        context, cmd, *args)
  self
end
imagebind_append(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 104
def imagebind_append(context, *args, &block)
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'],
                               context, cmd, *args)
  self
end
imagebind_remove(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 116
def imagebind_remove(*args)
  _bind_remove_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
  self
end
imagebindinfo(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 121
def imagebindinfo(*args)
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
end
index(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 187
def index(node)
  num_or_str(tk_send('index', tagid(node)))
end
insert(idx, parent, node, keys={}) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 191
def insert(idx, parent, node, keys={})
  tk_send('insert', idx, tagid(parent), tagid(node), *hash_kv(keys))
  self
end
line(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 196
def line(node)
  number(tk_send('line', tagid(node)))
end
move(parent, node, idx) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 200
def move(parent, node, idx)
  tk_send('move', tagid(parent), tagid(node), idx)
  self
end
nodes(node, first=None, last=None) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 209
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) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 215
def open?(node)
  bool(self.itemcget(tagid(node), 'open'))
end
open_tree(node, recurse=None) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 219
def open_tree(node, recurse=None)
  tk_send('opentree', tagid(node), recurse)
  self
end
parent(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 224
def parent(node)
  Tk::BWidget::Tree::Node.id2obj(self, tk_send('parent', tagid(node)))
end
reorder(node, neworder) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 228
def reorder(node, neworder)
  tk_send('reorder', tagid(node), neworder)
  self
end
see(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 233
def see(node)
  tk_send('see', tagid(node))
  self
end
selection_add(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 238
def selection_add(*args)
  tk_send_without_enc('selection', 'add',
                      *(args.collect{|node| tagid(node)}))
  self
end
selection_clear() click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 244
def selection_clear
  tk_send_without_enc('selection', 'clear')
  self
end
selection_get() click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 249
def selection_get
  list(tk_send_without_enc('selection', 'get'))
end
selection_include?(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 253
def selection_include?(*args)
  bool(tk_send_without_enc('selection', 'get',
                           *(args.collect{|node| tagid(node)})))
end
selection_range(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 258
def selection_range(*args)
  tk_send_without_enc('selection', 'range',
                      *(args.collect{|node| tagid(node)}))
  self
end
selection_remove(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 264
def selection_remove(*args)
  tk_send_without_enc('selection', 'remove',
                      *(args.collect{|node| tagid(node)}))
  self
end
selection_set(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 270
def selection_set(*args)
  tk_send_without_enc('selection', 'set',
                      *(args.collect{|node| tagid(node)}))
  self
end
selection_toggle(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 276
def selection_toggle(*args)
  tk_send_without_enc('selection', 'toggle',
                      *(args.collect{|node| tagid(node)}))
  self
end
tagid(tag) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 52
def tagid(tag)
  if tag.kind_of?(Tk::BWidget::Tree::Node)
    tag.id
  else
    # tag
    _get_eval_string(tag)
  end
end
textbind(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 125
def textbind(context, *args, &block)
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_for_event_class(Event_for_Items, [path, 'bindText'],
                        context, cmd, *args)
  self
end
textbind_append(context, *args, &block) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 137
def textbind_append(context, *args, &block)
  #if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
  if TkComm._callback_entry?(args[0]) || !block
    cmd = args.shift
  else
    cmd = block
  end
  _bind_append_for_event_class(Event_for_Items, [path, 'bindText'],
                               context, cmd, *args)
  self
end
textbind_remove(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 149
def textbind_remove(*args)
  _bind_remove_for_event_class(Event_for_Items, [path, 'bindText'], *args)
  self
end
textbindinfo(*args) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 154
def textbindinfo(*args)
  _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args)
end
toggle(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 282
def toggle(node)
  tk_send_without_enc('toggle', tagid(node))
  self
end
visible(node) click to toggle source
# File lib/tkextlib/bwidget/tree.rb, line 287
def visible(node)
  bool(tk_send_without_enc('visible', tagid(node)))
end

Private Instance Methods

__boolval_optkeys() click to toggle source
Calls superclass method TkConfigMethod#__boolval_optkeys
# File lib/tkextlib/bwidget/tree.rb, line 41
def __boolval_optkeys
  super() << 'dragenabled' << 'dropenabled' <<
    'redraw' << 'selectfill' << 'showlines'
end
__strval_optkeys() click to toggle source
Calls superclass method TkConfigMethod#__strval_optkeys
# File lib/tkextlib/bwidget/tree.rb, line 36
def __strval_optkeys
  super() << 'crossfill' << 'linesfill'
end
__tkvariable_optkeys() click to toggle source
Calls superclass method TkConfigMethod#__tkvariable_optkeys
# File lib/tkextlib/bwidget/tree.rb, line 47
def __tkvariable_optkeys
  super() << 'helpvar'
end