class documentation
A simple choice switch for the GUI.
| Method | __del__ |
Clean up resources and deinitialize LVGL. |
| Method | __init__ |
Initialize the Choice switch with drawing context and styling. |
| Method | clear |
Clear the choice area with the background color. |
| Method | close |
Close the dropdown menu (LVGL only currently). |
| Method | draw |
Render the choices on the display. |
| Method | is |
Check if the dropdown is open (LVGL only currently). |
| Method | open |
Open the dropdown menu (LVGL only currently). |
| Method | reset |
Reset the choice to its initial state. |
| Method | scroll |
Scroll down the choice options. |
| Method | scroll |
Scroll up the choice options. |
| Method | state |
Set the current state of the choice. |
| Instance Variable | background |
Undocumented |
| Instance Variable | display |
Undocumented |
| Instance Variable | foreground |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | options |
Undocumented |
| Instance Variable | position |
Undocumented |
| Instance Variable | size |
Undocumented |
| Instance Variable | title |
Undocumented |
| Instance Variable | use |
Undocumented |
| Property | state |
Get the current state of the choice. |
| Instance Variable | _lvgl |
Undocumented |
| Instance Variable | _state |
Undocumented |
def __init__(self, draw, position, size, title:
str, options: list[ str], initial_state: int = 0, foreground_color: int = 65535, background_color: int = 0):
¶
Initialize the Choice switch with drawing context and styling.
| Parameters | |
draw:Draw | The drawing context to render the choice. |
position:Vector | Vector position of the choice. |
size:Vector | Vector size of the choice. |
title:str | The label title for the choices. |
options:list[str] | List of option strings. |
initialint | Initial state of the choice. Defaults to 0. |
foregroundint | The color of the text. Defaults to 0xFFFF. |
backgroundint | The background color. Defaults to 0x0000. |