================= ListBox (hwx.gui) ================= A ListBox widget. Inherits: - :ref:`Widget (hwx.gui)` ---------- Properties ---------- +----------------+----------------+----------------+ | checked_ | items_ | selectedIndex_ | +----------------+----------------+----------------+ | selectionMode_ | viewMode_ | | +----------------+----------------+----------------+ -------------- Public Methods -------------- +---------------------------------------+ | append_ (self, item) | +---------------------------------------+ | clear_ (self) | +---------------------------------------+ | insert_ (self, item, index=9999999) | +---------------------------------------+ | isChecked_ (self, index) | +---------------------------------------+ | remove_ (self, index) | +---------------------------------------+ | select_ (self, index) | +---------------------------------------+ | setChecked_ (self, index, value=True) | +---------------------------------------+ | sort_ (self, ascending=True) | +---------------------------------------+ ---------------- Property Details ---------------- .. _checked: .. property:: checked Determines whether items in the list box are checked or not. By default, all are unchecked. Returns: list[bool] .. _items: .. property:: items Gets/Sets items of the ListBox .. _selectedIndex: .. property:: selectedIndex (int | None) The currently selected index. .. _selectionMode: .. property:: selectionMode Determines the way the items can be selected. Args: value (ListBox.selectionModeType): The type of selection to allow. .. _viewMode: .. property:: viewMode Determines the way the items can be viewed. Args: value (ListBox.viewMode): The type of view to allow. -------------- Method Details -------------- .. _append: .. method:: append(self, item) Appends an item to the end of the ListBox. :param item: Text value to be inserted. :type item: str .. _clear: .. method:: clear(self) Removes all items of the List Box. .. _insert: .. method:: 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: .. method:: isChecked(self, index) Returns whether the item at the specified index is checked or not :param index: :type index: int :returns: bool .. _remove: .. method:: remove(self, index) Remove item at index from List Box. :param index: index of item to be removed. :type index: int .. _select: .. method:: select(self, index) Select an index. Same as setting the selectedIndex except the command callback gets called. .. _setChecked: .. method:: 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: .. method:: 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