Expand description
Table — a virtualised data-table widget with header, scrolling body,
striping, overlines, row-selection, sort-toggle hooks and
scroll_to_row.
Designed to mirror the shape of egui_extras::TableBuilder so the same
mental model carries over: configure columns (auto / exact /
remainder.at_least(...).clip(...)), describe the row set
(Homogeneous { count, height } or Heterogeneous { heights }), and
provide cell + header painters. Cells are produced lazily — only rows
within the visible viewport are painted, so 100 000-row demos remain
cheap.
The widget intentionally does not know about your data: it owns the
chrome (backgrounds, separators, scroll, selection bookkeeping) and
invokes user-supplied painters for cell content. Cell painters get a
CellInfo (rect, row, column, selected, font, visuals) and may use any
of the project’s draw primitives.
Y-up note: agg-gui’s coordinate system has its origin at the bottom- left. Rows are stored top-down in the public API (row 0 visually topmost) and the widget converts to Y-up internally.
Resizable columns are intentionally not implemented in this first revision; the configuration is preserved so the API doesn’t break when it lands later.
Structs§
Enums§
- Column
Size - How a column derives its width.
- Table
Rows - Row-set description.
Constants§
- MIN_
COL_ W - Minimum width any column can be resized to.
- RESIZE_
HIT_ HALF - Pixel half-width of the resize hit zone around a column’s right edge.
Functions§
- clip_
text_ to_ width - Trim
textfrom the end with an ellipsis until it fitsmax_w, using the current font/size onctx. - distribute_
widths - Distribute
total_wacrosscolumnsaccording to their sizing modes.
Type Aliases§
- Cell
Painter - Header
Click - Optional callback for header clicks. Receives column index and click position relative to the header cell rect (Y-up).
- Header
Painter - RowPredicate
- Per-row predicate (e.g. for overlines).
- Rows
Provider - Callback returning the live row spec. Called on every layout pass when set, so external state changes (e.g. switching demo modes or resizing the dataset) flow into the table without an observer widget.