Skip to main content

Module cache

Module cache 

Source
Expand description

§WidgetCache

The WidgetCache stores every Widget in a window, much like the OBJECT tree of a GEM form on the Atari ST: Widgets live in a flat list, are addressed by their WidgetId (their index in the list), and are linked to their parents and children by ID. The top-level window Widget is always ID 0.

  ID 0  RootWidget (window)
   ├── ID 1  BaseWidget
   │    ├── ID 2  TextWidget      origins are relative to the parent
   │    └── ID 3  ButtonWidget
   └── ID 4  BoxWidget            later siblings are drawn on top

A flat list addressed by ID avoids reference-counted parent pointers entirely, and allows a form to be stored and reloaded by ID.

Structs§

WidgetCache
The tree of Widgets in a window.