class documentation
A simple text editor built for Picoware.
The callback is useful for saving to a file or updating a preview in real-time.
| Method | __init__ |
Initialize the TextEditor with a view manager and an optional callback. |
| Method | __setattr__ |
Set an attribute, routing text and cursor changes to setters. |
| Method | callback |
Set the callback function for text changes. |
| 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 |
Refresh the text editor display. |
| Method | run |
Runs the text editor - call this every frame/tick. |
| Method | set |
Set the text content of the text box. |
| Constant | TYPE |
Undocumented |
| Constant | TYPE |
Undocumented |
| Property | callback |
Gets the current callback function. |
| Property | current |
Returns the current text content of the text box. |
| Method | __process |
Process text input and update the textbox. |
| Instance Variable | _callback |
Undocumented |
| Instance Variable | _vm |
Undocumented |
Initialize the TextEditor with a view manager and an optional callback.
| Parameters | |
viewViewManager | The view manager to handle drawing and input. |
callback:callable | Callable taking (action_type, char, cursor_pos). Defaults to None. |
Set an attribute, routing text and cursor changes to setters.
| Parameters | |
name:str | The attribute name. |
| value | The attribute value. |