BBjWindow::getChildWindow

Description

Retrieves a BBjChildWindow object given a control ID. In BBj 14.00 and higher, this method supports reference to the BBjChildWindow by name.

Syntax

Return Value

Method

BBjChildWindow

getChildWindow(int ID)

BBjChildWindow

getChildWindow(string name)

Parameters

Variable

Description

ID

Specifies the Control ID of the child window.

name

Specifies the name of the child window.

Return Value

None.

Remarks

Returns the child window object if it exists. Returns null if the child window object does not exist.

Example

rem 'Get a child window from a top level window

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

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

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

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

rem 'Create a top level window
let myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

rem 'Create a child window
let myChildWindow! = myWindow!.addChildWindow(200,50,50,100,100,"",$$,1,$$)

rem 'Get the context of the child window and set it to be the current context
let CHILD_CONTEXT = mySysGui!.getContext()

rem 'Add a static text control on the child window
CHILD_TEXT$="Child Window"
let myStaticText! = myChildWindow!.addStaticText(300,X,Y,WIDTH,HEIGHT,CHILD_TEXT$)

rem 'Register the CALLBACK routines
CALLBACK(ON_CLOSE,APP_CLOSE,0)

rem 'Get the child window
childWindow! = myWindow!.getChildWindow(200)

rem 'Process Events
process_events

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

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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