AG_Treetbl * AG_TreetblNew (AG_Widget *parent, Uint flags, AG_TreetblDataFn dataFn, AG_TreetblSortFn sortFn)
void AG_TreetblSizeHint (AG_Treetbl *tbl, int width, int nrows)
void AG_TreetblSetRefreshRate (AG_Treetbl *tbl, Uint ms)
void AG_TreetblSetColHeight (AG_Treetbl *tbl, int height)
void AG_TreetblSetSortCol (AG_Treetbl *tbl, AG_TreetblCol *col)
void AG_TreetblSetSortMode (AG_Treetbl *tbl, enum ag_treetbl_sort_mode mode)
void AG_TreetblSetExpanderCol (AG_Treetbl *tbl, AG_TreetblCol *col)
|
The
AG_TreetblNew() function allocates, initializes, and attaches a new
AG_Treetbl widget.
The
dataFn() argument specifies the callback function from which to obtain the text
to display for a given cell.
The callback function should return a pointer to a valid C string to
display under the given cell, and is declared as:
char * MyDataFn (AG_Treetbl *tbl, int col, int row)
|
The
sortFn() argument, if not NULL, specifies an optional comparison function to
use in sorting cells, and is declared as:
int MySortFn (AG_Treetbl *tbl, int col1, int row1, int col2, int row2)
|
The
flags argument to
AG_TreetblNew() may include:
AG_TREETBL_MULTI | Allow selection of multiple rows at once while holding
CTRL or
SHIFT. | AG_TREETBL_MULTITOGGLE | Allow selection of multiple rows at once without holding
CTRL or
SHIFT. | AG_TREETBL_REORDERCOLS | Allow reordering of the columns through dragging and dropping of the column
headers.
| AG_TREETBL_NODUPCHECKS | Disable the safety check for duplicate row and column IDs.
This option avoids a lookup in
AG_TreetblAddCol() and
AG_TreetblAddRow(). | AG_TREETBL_SORT | Enable sorting of the rows.
| AG_TREETBL_POLLED | Enable polling mode such that the table can be repopulated automatically
to reflect some external data.
When a row is deleted,
AG_Treetbl will remember selection information for later use by
AG_TreetblRowRestoreAll(). | AG_TREETBL_HFILL | Expand horizontally in parent (equivalent to invoking
AG_ExpandHoriz(3)). | AG_TREETBL_VFILL | Expand vertically in parent (equivalent to invoking
AG_ExpandVert(3)). | AG_TREETBL_EXPAND | Shorthand for
AG_TREETBL_HFILL|AG_TREETBL_VFILL. This is recommended as an alternative to
AG_TreetblSizeHint(). |
The
AG_TreetblSizeHint() function requests an initial sizing, where
width is the width in pixels and
nrows is the number of rows to display.
AG_TreetblSetRefreshRate() sets the default update rate for dynamically updated cells.
AG_TreetblSetColHeight() sets the height of column headers in pixels.
AG_TreetblSetSortCol() specifies the column controlling the sorting of rows.
AG_TreetblSetSortMode() sets the sort method, where
mode is one of:
AG_TREETBL_SORT_NOT | No sorting
| AG_TREETBL_SORT_ASC | Sort in ascending order
| AG_TREETBL_SORT_DSC | Sort in descending order
|
AG_TreetblSetExpanderCol() specifies an alternate column for the tree expand/collapse controls.
By default, the first column is used.
|