Resources | Resources |



Widgets high level architecture

Brew MP UI Widgets are a C-based framework for creating UI applications. Each widget represents a visible element on the display, such as a softkey or a list, and resides in a container. When creating a user interface, an application must create at least one container, the root container, which holds all the elements of the display. The root container can contain widgets and other containers.

The root container manages the child widgets and containers, as follows:

  • Keeps track of the position and z-order of the widgets.

    When the root container contains multiple widgets, the widgets may overlap, with one widget hiding part or all of another widget. The z-order specifies the order of the widgets from top to bottom, where the top widget is visible and lower widgets may not be completely visible.

  • Passes events, such as key presses or touch events, to the appropriate widget.

  • Controls the drawing of the widgets on the display.

    When a widget's view is modified, it needs to be redrawn. The widget sends an invalidation request to its parent container, which sends it to its parent. Each container forwards the event to its parent, until the invalidation request reaches the root container. The root container schedules the drawing. If multiple invalidations occur, they can be redrawn at the same time.

For more information on containers, see Containers.