BBjTree::setRoot

Description

Creates the root node for the BBjTree control.

Syntax

Return Value Method
void setRoot(int ID, String text)

Parameters

Parameter Description
ID Specifies the ID of the root node.
text Specifies the text label of the root node.

Return Value

None.

Remarks

All trees must have only one root node. The root must be set before any other nodes are added.

Example

rem 'Create the root node of a tree control

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Open the SysGui device
SYSGUI = UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 200
HEIGHT = 200
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window that is initially invisible
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$,$00000012$)

rem 'Create the tree control on the window
myTree! = myWindow!.addTree(101,0,0,WIDTH,HEIGHT)

rem 'Create root node of tree
PARENT_ID = 0
myTree!.setRoot(PARENT_ID,"Musical Tree")

rem 'Show the window
myWindow!.setVisible(mySysGui!.TRUE)

rem 'Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjTree::getRoot

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.