GUI
Data Display Components
NAppGUI's main data-oriented widgets are ListBox and TableView. Both expose
higher-level list/table behavior at the public API, but their implementation sits on top of the custom-view stack
instead of delegating everything to a native list widget.
Relevant Source Files
ListBox
ListBox manages a sequence of rows with text, optional images, optional checkboxes, optional multiselection,
per-row foreground color, explicit selection state, and explicit check state. The public listener surface separates
OnDown from OnSelect, which is useful for controls that need press handling distinct from final selection.
The API shape shows that the widget is not just a platform list wrapper: row attributes like per-item image/color/check state are part of the portable surface, and the implementation is routed through the custom-view layer.
TableView
TableView is a richer data grid with explicit listener hooks for data requests, selection, row click,
and header click. It exposes text columns, optional per-cell icons with per-column icon sizing/margins,
per-column width/limits/alignment/resizability, frozen columns, header title/indicator/visibility/clickability,
row height, grid lines, multiselect, focus-row control, and explicit scroll-visibility management.
The design is closer to a portable grid framework than a minimal wrapper. Applications provide behavior through listeners and configure structure through column/header APIs.
Shared View Infrastructure
A key implementation detail is that both widgets are built on the same custom-view substrate used by View,
Label, and ImageView. That gives them portable drawing, custom mouse/keyboard routing, and a consistent
update path through the draw2d backend instead of forcing every platform backend to provide a native equivalent.
The trade-off is deliberate: NAppGUI chooses a richer cross-platform feature surface over strict dependence on whatever list/table widget each OS exposes.
When To Use Which Widget
| Widget | Best Fit |
|---|---|
ListBox |
Single-column lists with optional images, row coloring, and checkbox or multiselect behavior. |
TableView |
Multi-column data presentation with headers, sortable/clickable header semantics, and focus/selection control. |