pdwidgets

pdwidgets

Provides a collection of widgets for creating graphical user interfaces on embedded systems. It includes base classes for widgets, as well as specific widgets such as buttons, labels, sliders, and more.

Core (always imported): Display, Screen, Task, Widget, themes, constants.

Widgets load lazily via __getattr__ so MCU images only pay for modules you touch. Lean path:

from pdwidgets.widgets.button import Button

Convenience:

import pdwidgets as pd
pd.Button(...)  # imports widgets.button on first access

See widget-dependencies.md for the peer import graph.

Proportional fonts:

Label (and widgets built on it) gains proportional-font rendering when a font module is supplied. That path uses the private pdwidgets._write_font helper (fonts from write_font_converter).

Timer architecture:

pdwidgets owns no timer of its own. Each Display wires itself into the shared appdev.App at construction. Apps just build the UI; the app keeps itself alive past the end of the script.

pdwidgets.DEBUG = False

When True, enable extra debug logging in pdwidgets.

pdwidgets.MARK_UPDATES = False

When True, draw a colored border around flushed areas.