Widget
A simple widget for demonstration.
Usage
Widget()Parameters
name: str-
The name of the widget.
color: str = "red"-
The widget color.
Examples
>>> w = Widget("button", color="blue")
>>> w.name
'button'Methods
| Name | Description |
|---|---|
| render() | Render the widget as a string. |
| resize() | Resize the widget. |
render()
Render the widget as a string.
Usage
render()Returns
str-
An HTML-like string representation.
resize()
Resize the widget.
Usage
resize(width, height)Parameters
width: int-
New width in pixels.
height: int-
New height in pixels.