- added a onSelect event for lists
- added docs for onSelect
- added addPlugin and addObject docs
This commit is contained in:
Robert Jelic
2023-05-10 17:21:17 +02:00
parent d2f4717500
commit e35708902c
6 changed files with 117 additions and 5 deletions

View File

@@ -21,6 +21,12 @@ In addition to the Object and VisualObject methods, lists also have the followin
|[getSelectionColor](objects/List/getSelectionColor.md)|Returns default bg and fg selection color
|[isSelectionColorActive](objects/List/isSelectionColorActive.md)|Returns if it is using selection color
## Events
| | |
|---|---|
|[onSelect](objects/List/onSelect.md)|Fires when a item on the list get's selected
A item-table in lists looks like the following example:
```lua
@@ -43,7 +49,7 @@ aList:addItem("Item 1")
aList:addItem("Item 2", colors.yellow)
aList:addItem("Item 3", colors.yellow, colors.green)
aList:onChange(function(self, item)
aList:onSelect(function(self, item)
basalt.debug("Selected item: ", item.text)
end)
```