Fl_Tree // Top level widget |--- Fl_Tree_Item // Items in the tree |--- Fl_Tree_Prefs // Preferences for the tree |--- Fl_Tree_Connector (enum) // Connection modes |--- Fl_Tree_Select (enum) // Selection modes |--- Fl_Tree_Sort (enum) // Sort behavior
This is a hierarchical 'tree' browser widget that presents its data in a hierarchy. Nodes can optionally be open/closed, and items can be individually created, deleted, sorted, and attributes customized for different fonts and colors.
The simple way to define a tree:
Items can also be FLTK widgets, instead of just simple labels (default).
Fl_Tree derives from FLTK's Fl_Group, so that if FLTK widgets are added to the tree, they become children of the group.
Each item in the tree is an Fl_Tree_Item, which has customizable values for setting the font, color, and other attributes on a per-item basis.
Each tree contains an instance of the Fl_Tree_Prefs class, which handles global preferences for the tree, and the default values used for newly created items in the tree.
By default, when items are added to the tree, they're added in the order created. Sorting can be specified with the Fl_Tree::sortorder() method.