Class Tk::BWidget::ListBox
In: tk/lib/tkextlib/bwidget/listbox.rb
Parent: TkWindow

Methods

Included Modules

TkItemConfigMethod Scrollable

Classes and Modules

Class Tk::BWidget::ListBox::Event_for_Items
Class Tk::BWidget::ListBox::Item

Constants

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

Public Instance methods

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 85
  def delete(*args)
    tk_send('delete', *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 90
  def edit(item, text, *args)
    tk_send('edit', tagid(item), text, *args)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 95
  def exist?(item)
    bool(tk_send('exists', tagid(item)))
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 108
  def get_item(idx)
    tk_send('items', idx)
  end

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 99
  def index(item)
    num_or_str(tk_send('index', tagid(item)))
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 103
  def insert(idx, item, keys={})
    tk_send('insert', idx, tagid(item), *hash_kv(keys))
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 112
  def items(first=None, last=None)
    list(tk_send('items', first, last))
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 116
  def move(item, idx)
    tk_send('move', tagid(item), idx)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 121
  def reorder(neworder)
    tk_send('reorder', neworder)
    self
  end

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 126
  def see(item)
    tk_send('see', tagid(item))
    self
  end

[Source]

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

[Source]

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

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 154
  def selection_get(*args)
    simplelist(tk_send_without_enc('selection', 'get')).collect{|item|
      Tk::BWidget::ListBox::Item.id2obj(self, item)
    }
  end

[Source]

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

[Source]

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

[Source]

# File tk/lib/tkextlib/bwidget/listbox.rb, line 38
  def tagid(tag)
    if tag.kind_of?(Tk::BWidget::ListBox::Item)
      tag.id
    else
      # tag

      _get_eval_string(tag)
    end
  end

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Validate]