Files
Basalt/docs/objects/List.md
Robert Jelic 4d614372a1 Updated docs
There is still stuff to do
2022-08-28 18:18:26 +02:00

1.4 KiB

Lists are objects where you can create endless entries, and the user is able to select one of them

Object methods also apply for lists.

addItem Adds a new item into the list
removeItem Removes a item from the list
editItem Changes a already existing item in the list
getItem Returns a item by its index
getItemCount Returns the item count
getAll Returns the entire list as a table
selectItem Selects a item
clear Makes the entire list empty
getItemIndex Returns the currently active item index
setSelectedItem Changes the default bg and fg, when the user selects a item
setOffset Changes the list offset
getOffset Returns the current offset
setScrollable Makes the list scrollable

A item-table in lists looks like the following example:

item = {
  text="1. Entry",  -- the text its showing
  bgCol=colors.black,  -- the background color
  fgCol=colors.white -- the foreground color
  args = {} -- custom args you want to pass, which you will be able to access in for example onChange events
}