Class Tk::Iwidgets::Hierarchy
In: tk/lib/tkextlib/iwidgets/hierarchy.rb
Parent: Tk::Iwidgets::Scrolledwidget

Methods

Included Modules

TkTextTagConfig Tk::ValidateConfigure

Classes and Modules

Class Tk::Iwidgets::Hierarchy::IconCommand
Class Tk::Iwidgets::Hierarchy::IndicatorCommand
Class Tk::Iwidgets::Hierarchy::QueryCommand

Constants

ItemConfCMD = ['tag'.freeze, 'configure'.freeze].freeze
TkCommandNames = ['::iwidgets::hierarchy'.freeze].freeze
WidgetClassName = 'Hierarchy'.freeze

Public Instance methods

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 94
  def __validation_class_list
    super << QueryCommand << IndicatorCommand << IconCommand
  end

based on TkText widget

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 197
  def bbox(index)
    list(tk_send_without_enc('bbox', _get_eval_enc_str(index)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 104
  def clear
    tk_call(@path, 'clear')
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 109
  def collapse(node)
    tk_call(@path, 'collapse')
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 201
  def compare(idx1, op, idx2)
    bool(tk_send_without_enc('compare', _get_eval_enc_str(idx1), 
                             op, _get_eval_enc_str(idx2)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 114
  def current
    tk_call(@path, 'current')
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 206
  def debug
    bool(tk_send_without_enc('debug'))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 209
  def debug=(boolean)
    tk_send_without_enc('debug', boolean)
    #self

    boolean
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 215
  def delete(first, last=None)
    tk_send_without_enc('delete', first, last)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 220
  def dlineinfo(index)
    list(tk_send_without_enc('dlineinfo', _get_eval_enc_str(index)))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 118
  def draw(mode=None)
    case mode
    when None
      # do nothing

    when 'now', :now
      mode = '-now'
    when 'eventually', :eventually
      mode = '-eventually'
    when String, Symbol
      mode = mode.to_s
      mode = '-' << mode if mode[0] != ?-
    end
    tk_call(@path, 'draw', mode)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 142
  def exp_state
    list(tk_call(@path, 'expState'))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 133
  def expand(node)
    tk_call(@path, 'expand', node)
    self
  end
expand_state()

Alias for exp_state

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 138
  def expanded?(node)
    bool(tk_call(@path, 'expanded', node))
  end
expanded_list()

Alias for exp_state

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 224
  def get(*index)
    _fromUTF8(tk_send_without_enc('get', *index))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 228
  def index(index)
    tk_send_without_enc('index', _get_eval_enc_str(index))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 232
  def insert(index, chars, *tags)
    if tags[0].kind_of? Array
      # multiple chars-taglist argument :: str, [tag,...], str, [tag,...], ...

      args = [chars]
      while tags.size > 0
        args << tags.shift.collect{|x|_get_eval_string(x)}.join(' ')  # taglist

        args << tags.shift if tags.size > 0                           # chars

      end
      super index, *args
    else
      # single chars-taglist argument :: str, tag, tag, ...

      if tags.size == 0
        super index, chars
      else
        super index, chars, tags.collect{|x|_get_eval_string(x)}.join(' ')
      end
    end
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 152
  def mark_add(*nodes)
    tk_call(@path, 'mark', 'add', *nodes)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 148
  def mark_clear
    tk_call(@path, 'mark', 'clear')
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 160
  def mark_get
    list(tk_call(@path, 'mark', 'get'))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 156
  def mark_remove(*nodes)
    tk_call(@path, 'mark', 'remove', *nodes)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 169
  def prune(node)
    tk_call(@path, 'prune', node)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 164
  def refresh(node)
    tk_call(@path, 'refresh', node)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 255
  def scan_dragto(x, y)
    tk_send_without_enc('scan', 'dragto', x, y)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 251
  def scan_mark(x, y)
    tk_send_without_enc('scan', 'mark', x, y)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 259
  def see(index)
    tk_send_without_enc('see', index)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 178
  def selection_add(*nodes)
    tk_call(@path, 'selection', 'add', *nodes)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 174
  def selection_clear
    tk_call(@path, 'selection', 'clear')
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 186
  def selection_get
    list(tk_call(@path, 'selection', 'get'))
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 182
  def selection_remove(*nodes)
    tk_call(@path, 'selection', 'remove', *nodes)
    self
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 190
  def toggle(node)
    tk_call(@path, 'toggle', node)
    self
  end

based on tk/scrollable.rb

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 265
  def xview(*index)
    if index.size == 0
      list(tk_send_without_enc('xview'))
    else
      tk_send_without_enc('xview', *index)
      self
    end
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 273
  def xview_moveto(*index)
    xview('moveto', *index)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 276
  def xview_scroll(*index)
    xview('scroll', *index)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 280
  def yview(*index)
    if index.size == 0
      list(tk_send_without_enc('yview'))
    else
      tk_send_without_enc('yview', *index)
      self
    end
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 288
  def yview_moveto(*index)
    yview('moveto', *index)
  end

[Source]

# File tk/lib/tkextlib/iwidgets/hierarchy.rb, line 291
  def yview_scroll(*index)
    yview('scroll', *index)
  end

[Validate]