Class: Tk::BWidget::ListBox

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

### Methods

delete edit exist? get_item imagebind imagebind_append imagebind_remove imagebindinfo index insert items move reorder see selection_add selection_clear selection_get selection_remove selection_set tagid textbind textbind_append textbind_remove textbindinfo

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

delete(*args)

[Source]

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

edit(item, text, *args)

[Source]

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

exist?(item)

[Source]

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

get_item(idx)

[Source]

    # File tk/lib/tkextlib/bwidget/listbox.rb, line 157
      def get_item(idx)
        tk_send('items', 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/listbox.rb, line 56
      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/listbox.rb, line 72
      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/listbox.rb, line 84
      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/listbox.rb, line 89
      def imagebindinfo(*args)
        _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args)
      end

index(item)

[Source]

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

insert(idx, item, keys={})

[Source]

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

items(first=None, last=None)

[Source]

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

move(item, idx)

[Source]

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

reorder(neworder)

[Source]

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

see(item)

[Source]

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

selection_add(*args)

[Source]

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

selection_clear()

[Source]

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

selection_get(*args)

[Source]

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

selection_remove(*args)

[Source]

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

selection_set(*args)

[Source]

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

tagid(tag)

[Source]

    # File tk/lib/tkextlib/bwidget/listbox.rb, line 43
      def tagid(tag)
        if tag.kind_of?(Tk::BWidget::ListBox::Item)
          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/listbox.rb, line 97
      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/listbox.rb, line 113
      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/listbox.rb, line 125
      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/listbox.rb, line 130
      def textbindinfo(*args)
        _bindinfo_for_event_class(Event_for_Items, [path, 'bindText'], *args)
      end

[Validate]