                         PY-GTKTREE EXAMPLES

Py-gtktree comes with a set of examples that show how to use the
package.  All examples have their source code divided into sections.
The part or parts that are actually relevant to Py-gtktree and the
demonstrated functionality have 'EXAMPLE:' in their titles.  Parts
titled 'Importing and other auxiliary stuff', 'Loading UI definition'
and 'General UI setup' involve some routine setup and can be skipped.

All examples use external UI definition in XML files loaded with
gtk.Builder to avoid cluttering the code.



                     EXAMPLE USAGE OF LIST STORE

Several examples show how to create and use RowObjectListStore.  They
range from simple model creation to more advanced topics like
drag'n'drop and lazy loading.

simple_list.py

    Demonstrates simple usage of RowObjectListStore with pre-existing
    objects.  You can use any objects as model rows, in this case
    imported Python modules.

drag_between_lists.py

    Creates two lists of objects and enables dragging between them.
    Note that the lists have different number of columns, yet it
    doesn't hinder drag'n'drop at all.  The objects in both lists are
    the same and are completely unrelated to model columns.

lazy_value_loading.py

    Demonstrates lazy loading of individual values in a list.  Uses
    several methods in TreeViewUtils to watch and retrieve set of
    currently visible rows.  Adds a random delay before a value is
    loaded to make loading visible and emulate some slow connection.



                     EXAMPLE USAGE OF TREE STORE

simple_tree.py

    Demonstrates simple usage of RowObjectTreeStore to display
    pre-existing trees (XML).  However, tree structure has to be
    created anew, because there is no standard way to express trees in
    Python.  Includes minimal example of model modification: if a
    different XML is parsed, model contents is replaced.

editing_tree.py

    Shows several editing operations on a tree.  Currently implemented
    operations are:

    - adding new nodes;
    - removing existing nodes;
    - drag'n'drop node relocation;
    - editing individual cells (text strings and boolean checkboxes).

lazy_tree_structure.py

    Demonstrates lazy creation of tree structure.  Shows optional
    behavior of lazy nodes: such nodes can claim to have children even
    if it later turns out to be false.  However, this situation
    doesn't cause an error and node expander is silently removed upon
    finding that there are actually no child nodes.



                         COMBINATION EXAMPLES

drag_between_tree_and_list.py

    Allows to drag individual rows between a tree and list to make
    selection.  Makes not all tree nodes draggable: some serve as
    section headers.
