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_open 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_down Scroll down the choice options.
Method scroll_up Scroll up the choice options.
Method state.setter Set the current state of the choice.
Instance Variable background_color Undocumented
Instance Variable display Undocumented
Instance Variable foreground_color Undocumented
Instance Variable is_circular Undocumented
Instance Variable options Undocumented
Instance Variable position Undocumented
Instance Variable size Undocumented
Instance Variable title Undocumented
Instance Variable use_lvgl Undocumented
Property state Get the current state of the choice.
Instance Variable _lvgl_choice Undocumented
Instance Variable _state Undocumented
def __del__(self):

Clean up resources and deinitialize LVGL.

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:DrawThe drawing context to render the choice.
position:VectorVector position of the choice.
size:VectorVector size of the choice.
title:strThe label title for the choices.
options:list[str]List of option strings.
initial_state:intInitial state of the choice. Defaults to 0.
foreground_color:intThe color of the text. Defaults to 0xFFFF.
background_color:intThe background color. Defaults to 0x0000.
def clear(self):

Clear the choice area with the background color.

def close(self):

Close the dropdown menu (LVGL only currently).

def draw(self):

Render the choices on the display.

def is_open(self) -> bool:

Check if the dropdown is open (LVGL only currently).

def open(self):

Open the dropdown menu (LVGL only currently).

def reset(self):

Reset the choice to its initial state.

def scroll_down(self):

Scroll down the choice options.

def scroll_up(self):

Scroll up the choice options.

def state(self, value: int):

Set the current state of the choice.

Parameters
value:intThe new state index.
background_color =

Undocumented

display =

Undocumented

foreground_color =

Undocumented

is_circular =

Undocumented

options =

Undocumented

position =

Undocumented

size =

Undocumented

title =

Undocumented

use_lvgl =

Undocumented

@property
state: int =

Get the current state of the choice.

_lvgl_choice =

Undocumented

_state =

Undocumented