ListBox (hwx.gui)¶
A ListBox widget.
- Inherits:
Properties¶
Public Methods¶
Property Details¶
- property checked¶
Determines whether items in the list box are checked or not.
By default, all are unchecked.
- Returns:
list[bool]
- property items¶
Gets/Sets items of the ListBox
- property selectedIndex¶
(int | None) The currently selected index.
- property selectionMode¶
Determines the way the items can be selected.
- Args:
value (ListBox.selectionModeType): The type of selection to allow.
- property viewMode¶
Determines the way the items can be viewed.
- Args:
value (ListBox.viewMode): The type of view to allow.
Method Details¶
- append(self, item)¶
Appends an item to the end of the ListBox.
- param item
Text value to be inserted.
- type item
str
- clear(self)¶
Removes all items of the List Box.
- insert(self, item, index=9999999)¶
Inserts an item in the ListBox at position index.
By default it gets appended to the end.
- param item
Text value to be inserted.
- type item
str
- param index
Index at which item is inserted.
- type index
int
- isChecked(self, index)¶
Returns whether the item at the specified index is checked or not
- param index
- type index
int
- returns
bool
- remove(self, index)¶
Remove item at index from List Box.
- param index
index of item to be removed.
- type index
int
- select(self, index)¶
Select an index.
Same as setting the selectedIndex except the command callback gets called.
- setChecked(self, index, value=True)¶
Checks or unchecks the item at the specified index.
- param index
- type index
int
- param value
- type value
bool
- sort(self, ascending=True)¶
Sorts the items in the ListBox, based on their text.
- param ascending
If set to True, sort the items in ascending order.
- type ascending
bool