class documentation
class TextBox(textbox.TextBox):
Constructor: TextBox(draw, y, height, foreground_color, ...)
Class for a text box with scrolling functionality.
| Method | __del__ |
Clean up resources and deinitialize LVGL. |
| Method | __init__ |
Initialize the text box with position, height, and styling. |
| Method | __setattr__ |
Set an attribute, routing text and cursor changes to setters. |
| Method | clear |
Clears the text box content and screen. |
| Method | current |
Set the current text content. |
| Method | jump |
Moves the cursor and viewport to the end of the text and redraws. |
| Method | jump |
Moves the cursor and viewport to the beginning of the text and redraws. |
| Method | refresh |
Refreshes the text box display to reflect any changes in content or state. |
| Method | scroll |
Scrolls the text box content down by one line |
| Method | scroll |
Scrolls the text box content up by one line |
| Method | set |
Set the current line index for the visible portion of the text. |
| Method | set |
Update the text content and refresh the display. |
| Instance Variable | use |
Undocumented |
| Property | current |
Returns the current text content of the text box. |
| Property | text |
Returns the total height of the text content in pixels. |
| Instance Variable | _draw |
Undocumented |
| Instance Variable | _lvgl |
Undocumented |
def __init__(self, draw, y:
int, height: int, foreground_color: int = 65535, background_color: int = 0, show_scrollbar: bool = True, show_cursor: bool = False):
¶
Initialize the text box with position, height, and styling.
| Parameters | |
draw:Draw | The drawing context to render the text box. |
y:int | The top Y position of the text box. |
height:int | The height of the text box. |
foregroundint | The text color. Defaults to 0xFFFF. |
backgroundint | The background color. Defaults to 0x0000. |
showbool | Whether to show the scrollbar. Defaults to True. |
showbool | Whether to show the cursor. Defaults to False. |
Set an attribute, routing text and cursor changes to setters.
| Parameters | |
name:str | The attribute name. |
| value | The attribute value. |
Set the current line index for the visible portion of the text.
| Parameters | |
line:int | The line index to show. |