BBjTree::setRoot

Description

Creates the root node for the BBjTree control.

Syntax

Return Value

Method

void

setRoot(int ID, string text)

Parameters

Variable

Description

ID

Specifies the ID of the root node.

text

Specifies the text for the 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
RETURN

See Also

BBjAPI

BBjSysGui

BBjControl

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