Fl_Tree Widget

tree-simple-screenshot.png

     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

Overview

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:

    Fl_Tree tree(X,Y,W,H);
    tree.begin();
      tree.add("Flintstones/Fred");
      tree.add("Flintstones/Wilma");
      tree.add("Flintstones/Pebbles");
      tree.add("Simpsons/Homer");
      tree.add("Simpsons/Marge");
      tree.add("Simpsons/Bart");
      tree.add("Simpsons/Lisa");
    tree.end();

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.

tree-elements.png

Generated on Thu Jun 4 05:05:42 2009 for Fl_Tree by  doxygen 1.5.6