Tornado API Reference : GUI Tcl Library (UNIX)

motifHierarchy

NAME

motifHierarchy - Tcl interface and managament of Motif HierarcyView objects

TCL PROCEDURES

hierarchyCreate - create a hierarchy window
hierarchyPost - post a hierarchy
hierarchyDestroy - destroy a hierarchy
hierarchyExists - test for the existence of a hierarchy
hierarchyList - return a list of all existing hierarchies
hierarchyIsDisplayed - check if a hierarchy window is displayed
hierarchySetStructure - set the structure of a hierarchy
hierarchySetValues - set the values of terminal nodes in a hierarchy
hierarchyHighlight - highlight a given node in a hierarchy
hierarchyUnhighlight - highlight a given node in a hierarchy

DESCRIPTION

This library allows to manipulate motif HierarchyView objects for Tcl UNIX GUI

SEE ALSO

motifHierarchy


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyCreate

NAME

hierarchyCreate - create a hierarchy window

LOCALE

UNIX GUI

SYNOPSIS

hierarchyCreate [-destroy proc] [-change] [-special] name [callback]

DESCRIPTION

A new hierarchy window is created with the specified name. Before it can be seen, a hierarchy must be configured with hierarchySetStructure (and possibly hierarchySetValues) and posted with hierarchyPost.

The -change flag requests that the hierarchy highlight values that have changed from one evaluation to the next. The -special flag limits the applicability of the callback: clicking on any hierarchy item invokes the callback unless the -special flag is set; setting -special means that only items marked as traversable (by the string "*:" in the structure item name) invoke the callback when clicked.

If -destroy is given, proc is used as the name of a Tcl procedure that is invoked if the hierarchy window is destroyed by the user. The procedure is invoked with one argument: the name of the hierarchy window.

SEE ALSO

motifHierarchy, hierarchySetStructure, hierarchySetValues, hierarchyPost, hierarchyDestroy


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyPost

NAME

hierarchyPost - post a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchyPost name

DESCRIPTION

The named hierarchy is posted, making it visible on the display. It is not an error to attempt to post a nonexistent hierarchy.

SEE ALSO

motifHierarchy, hierarchyCreate


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyDestroy

NAME

hierarchyDestroy - destroy a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchyDestroy name

DESCRIPTION

The named hierarchy is completely destroyed; it is removed from the screen and its definition forgotten.

SEE ALSO

motifHierarchy, hierarchyCreate


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyExists

NAME

hierarchyExists - test for the existence of a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchyExists name

DESCRIPTION

This function tests for the existence of a specified hierarchy.

RETURNS

1 if the named hierarchy exists, 0 otherwise.

SEE ALSO

motifHierarchy, hierarchyList, hierarchyCreate


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyList

NAME

hierarchyList - return a list of all existing hierarchies

LOCALE

UNIX GUI

SYNOPSIS

hierarchyList

DESCRIPTION

This function returns a list of the names of all existing hierarchies.

SEE ALSO

motifHierarchy, hierarchyCreate, hierarchyPost, hierarchyExists


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyIsDisplayed

NAME

hierarchyIsDisplayed - check if a hierarchy window is displayed

LOCALE

UNIX GUI

SYNOPSIS

hierarchyIsDisplayed name

DESCRIPTION

This function checks to see if the specified window is displayed.

RETURNS

1 if the hierarchy is currently visible (posted and not iconified), 0 otherwise.

SEE ALSO

motifHierarchy, hierarchyPost, hierarchyCreate, hierarchyExists


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchySetStructure

NAME

hierarchySetStructure - set the structure of a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchySetStructure name structure

DESCRIPTION

A hierarchy is set to contain a list of names, each of which itself may contain a vector of subordinate names. These named entries in a hierarchy are called "nodes". A node is called "terminal" if it does not have subordinate nodes. Any terminal node may also be given an associated value by the command hierarchySetValues. The structure of a hierarchy is a nested list in Tcl syntax. Each item represents a node. If an item is itself a list of exactly two elements, the first element represents the name of the node, and the second element is taken as a list of subnodes. For example, the "structure string"

    A {B {b1 b2}} C D {E {{e1 {e11 e12 e13}} e2}} F
represents this hierarchy:

    A
  - B 
        b1
        b2
    C
    D
  - E
      - e1
            e11
            e12
            e13
        e2
    F
(The - flags indicate that the node is considered "expandable", because it contains children. This is usually marked in a displayed hierarchy as an "open folder" icon.)

There is a subtlety in the syntax of a hierarchy structure string: nodes that have two list elements represent nodes with children, while nodes with one or more than two elements represent single terminal nodes. Hence, the structure string

    A {hi there} C 
represents the hierarchy

    A
  - hi
        there
    C
If "hi there" is meant to be a simple node parallel with A and C, it must be written with either one or more than two elements, e.g.:

    A {hi-there} C

HIERARCHY VALUES

At any time hierarchySetValues can be called, which fills in the value strings of the terminal nodes with strings from the supplied value list. If the first hierarchy given above had hierarchySetValues invoked with the following string

    1 {2 3} 4 5 {{6 7 8} 9} 10
The values would be assigned as follows:

    A = 1
  - B 
        b1 = 2
        b2 = 3
    C = 4
    D = 5
  - E
      - e1
            e11 = 6
            e12 = 7
            e13 = 8
        e2 = 9
    F = 10
Note that only terminal nodes can receive values, and that the list structure of the value string mirrors that of the structure string.

ARRAY NODES

It is possible for a node to be marked as an "array node". In this case, the second element of the structure for the node uses the special name "+". If the subnode is simply named "+", the array is a simple array of terminal values. When values are assigned to array nodes, the number of items in the value list becomes the number of children of the array node. This number can grow or shrink. Given the structure string

    A {B +}
and the value string

    v {w x y z}
the resulting hierarchy is:

    A = v
  - B
        0 = w
        1 = x 
        2 = y
        3 = z
Child nodes of B are automatically created and given names starting with "0". Supplying another value string "v {a b}" would reduce the number of elements subordinate to B to 2.

The array constructor "+" can be nested: the structure/value pair

    {A {+ {+}}}                       {{1 2} {3 4} {5 6}}
results in the "two dimensional array" hierarchy

  - A
      - 0
            0 = 1
            1 = 2
      - 1
            0 = 3
            1 = 4
      - 2   
            0 = 5
            1 = 6

STRUCTURED ARRAY NODES

Arrays can also have substructure. This is indicated by replacing "+" with a two-element list, where the first element is "+" and the second is a structure string representing the array substructure. For an array of structures, each having a member "n" and a substructure member "coord", with members "x" and "y", one could write for structure and value:

    {Point {+ {n {coord {x y}}}}}     {{1 {2 3}} {4 {5 6}}}
Yielding:

  - Point
      - 0
            n = 1
          - coord
                x = 2
                y = 3
      - 1 
            n = 4
          - coord
                x = 5
                y = 6

SEE ALSO

motifHierarchy, hierarchySetValues, hierarchyCreate


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchySetValues

NAME

hierarchySetValues - set the values of terminal nodes in a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchySetValues name value

DESCRIPTION

The named hierarchy has its terminal node values set according to the structured list value. See the documentation for hierarchySetStructure for a discussion of hierarchy values.

SEE ALSO

motifHierarchy, hierarchySetStructure, hierarchyCreate


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyHighlight

NAME

hierarchyHighlight - highlight a given node in a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchyHighlight name path

DESCRIPTION

Within the named hierarchy, the terminal node described by path is highlighted. Path is a list of node names that describes the chain of nodes starting with the root node of the hierarchy. More than one node in a hierarchy can be highlighted. Nonterminal nodes cannot be highlighted.

EXAMPLE

Suppose the structure string of the hierarchy named c is:

{fruit {apple cherry}} {vegetable {carrot onion}}
To highlight the carrot node one would issue the command:

hierarchyHighlight c {vegetable carrot}

SEE ALSO

motifHierarchy, hierarchyUnhighlight, hierarchyCreate, hierarchySetStructure


GUI Tcl Library (UNIX) : Tcl Procedures

hierarchyUnhighlight

NAME

hierarchyUnhighlight - highlight a given node in a hierarchy

LOCALE

UNIX GUI

SYNOPSIS

hierarchyUnhighlight name path

DESCRIPTION

This command undoes the work of hierarchyHighlight. See that command for a description of the arguments to this one.

SEE ALSO

motifHierarchy, hierarchyHighlight, hierarchyCreate, hierarchySetStructure