class documentation
A simple list class for a GUI.
| Method | __del__ |
Destructor to clean up resources |
| Method | __init__ |
Initialize the list with drawing context and styling. |
| Method | add |
Add an item to the list. |
| Method | clear |
Clear the list. |
| Method | draw |
Draw the list. |
| Method | get |
Get an item from the list. |
| Method | item |
Check if an item exists in the list. |
| Method | remove |
Remove an item from the list and update the display. |
| Method | scroll |
Scroll the list down by one item. |
| Method | scroll |
Scroll the list up by one item. |
| Method | set |
Set the selected item in the list. |
| Instance Variable | background |
Undocumented |
| Instance Variable | border |
Undocumented |
| Instance Variable | border |
Undocumented |
| Instance Variable | box |
Undocumented |
| Instance Variable | box |
Undocumented |
| Instance Variable | box |
Undocumented |
| Instance Variable | display |
Undocumented |
| Instance Variable | dot |
Undocumented |
| Instance Variable | height |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | item |
Undocumented |
| Instance Variable | items |
Undocumented |
| Instance Variable | menu |
Undocumented |
| Instance Variable | position |
Undocumented |
| Instance Variable | rec |
Undocumented |
| Instance Variable | rec |
Undocumented |
| Instance Variable | selected |
Undocumented |
| Instance Variable | size |
Undocumented |
| Instance Variable | size |
Undocumented |
| Instance Variable | text |
Undocumented |
| Instance Variable | text |
Undocumented |
| Instance Variable | use |
Undocumented |
| Instance Variable | visible |
Undocumented |
| Instance Variable | y |
Undocumented |
| Property | current |
Get the currently selected item. |
| Property | item |
Get the number of items in the list. |
| Property | list |
Get the height of the list. |
| Property | selected |
Get the selected index. |
| Instance Variable | _dec |
Undocumented |
| Instance Variable | _dec |
Undocumented |
| Instance Variable | _draw |
Undocumented |
| Instance Variable | _five |
Undocumented |
| Instance Variable | _lvgl |
Undocumented |
| Instance Variable | _selected |
Undocumented |
| Instance Variable | _sixteen |
Undocumented |
| Instance Variable | _three |
Undocumented |
def __init__(self, draw, y:
int, height: int, text_color: int = 65535, background_color: int = 0, selected_color: int = 31, border_color: int = 65535, border_width: int = 2):
¶
Initialize the list with drawing context and styling.
| Parameters | |
draw:Draw | The drawing context to render the list. |
y:int | The top Y position of the list. |
height:int | The height of the list. |
textint | The text color. Defaults to 0xFFFF. |
backgroundint | The background color. Defaults to 0x0000. |
selectedint | The selected item color. Defaults to 0x001F. |
borderint | The border color. Defaults to 0xFFFF. |
borderint | The border width. Defaults to 2. |
Get an item from the list.
| Parameters | |
index:int | The index of the item. |
| Returns | |
str | The item string, or "" if not found. |
Check if an item exists in the list.
| Parameters | |
item:str | The item to look for. |
| Returns | |
bool | True if the item exists. |
Remove an item from the list and update the display.
| Parameters | |
index:int | The index of the item to remove. |
Scroll the list down by one item.
| Parameters | |
swap:bool | Whether to swap the display buffer. Defaults to True. |
Scroll the list up by one item.
| Parameters | |
swap:bool | Whether to swap the display buffer. Defaults to True. |