Command: treenode_define

Syntax

treenode_define <type> "{"
    <data-block>
"}"

Description

To define a treenode class structure for node objects in a tree window.

Parameters

Switches

None

Data Block

Each line of the data block defines a class value for the structure, in the form:

<member> = <value>

where <member> is one of:

Notes

The class command may also be used to define a treenode class, by inheriting from treenode.

Example

# Define a class of treenode to represent a database
treenode_define ~test.database_t {
    class_label = 'Databases'
    class_image = <'folder_0.xpm','folder_1.xpm'>
    value_image = <'book_0.xpm','book_1.xpm'>
    populate = {
    # When a node requires population ...
        args t=treenode
        if (t.has_value) {
        # Expanding a value node - add users and tables
        # class nodes
            t.add_child('~test.user_t')
            t.add_child('~test.table_t')
        }
        else {
        # Expanding a class node - show all databases
            t.add_child('~test.database_t',1,0,0,0,'DB1')
            t.add_child('~test.database_t',1,0,0,0,'DB2')
        }
    }
}

See Also

Commands:

class, treenode, wtree

Identifiers:

tn# (treenode)

Structures:

treenode