# listbox class

A widget displaying a list of items

Inherits
object widget
Description

The listbox class is a widget displaying a list of string items.
The listbox can operate in four selection modes: single, multi, extended and none. In the "single" mode only one item can be selected at a time and that item is also the current one. In the "multi" mode multiple items can be selected and unselected and the current item may or may not be one of the selected items. In the "extended" mode multiple items can be selected but they must be selected in a single mouse action or by keeping the shift button pressed while clicking on the item. In this mode the current item is always one of the selected items.
In the "none" mode no items can be selected and the current item may be any item in the list.
In most situations you will operate the listbox in "single" mode (and this is the default mode set at widget creation).

Functions

`$setSelectionMode(<mode>)`
Sets the current selection mode specified by the parameter <mode> that can be one of the following string: "single" : only one item can be selected at a time "multi" : multiple items can be selected at a time "extended" : multiple items can be selected but only in a single mouse interaction "none" : no items can be selected The default mode is "single"
`$selectionMode()`
Returns the current selection mode
`$insertList(<list>, <index>)`
Inserts the items present in the <list> object starting from index <index>, which is -1 by default (which means the items will be appended).
`$insertItem(<str>, <index>)`
Inserts a text item at position <index>. If index is negative or not specified the item is appended.
`$changeItem(<str>, <index>)`
Changes text of item at <index> to <str>.
`$removeItem(<index>)`
Removes item at given index.
`$count()`
Returns number of items in the widget.
`$currentText()`
Returns the text of the currently selected item.
`$currentItem()`
Returns index of current item or -1 if no item is current.
`$textAt(<index>)`
Returns item at given index.
`$setCurrentItem(<index>)`
Sets the current listbox item.
`$clear()`
Removes all the items
`$isSelected(<index>)`
Returns 1 if the item at <index> is selected and 0 otherwise
`$setSelected(<index>,<bool>)`
Changes the selection status of the item at <index> to the value specified by <bool>. If <bool> is 1 the item is selected, if <bool> is 0 the item is unselected.
`$selectionChangeEvent()`
This function is called by KVIrc when the selection in the listbox changes.
`$currentItemChangeEvent()`
This function is called by KVIrc when the current item changes.

Index, Object Classes

KVIrc 3.2.0 Documentation
Generated by root at Thu Mar 9 08:43:54 2006