Instead of owning a CharGrid directly, a Panel owns a Window, which owns a CharGrid.
The Window implements the logic for determining which cells of the CharGrid to display in the Panel. This includes calculating reflow and also managing moving the window around the CharGrid independently of the cursor (e.g. because the user has scrolled the terminal back to see old output).
Instead of owning a
CharGrid
directly, aPanel
owns aWindow
, which owns aCharGrid
.The
Window
implements the logic for determining which cells of theCharGrid
to display in thePanel
. This includes calculating reflow and also managing moving the window around the CharGrid independently of the cursor (e.g. because the user has scrolled the terminal back to see old output).