BBjSysGui::getWindow

Description

Returns the BBjWindow object associated with the specified context. If the window is a top level window, it can be cast to a BBjTopLevelWindow with the CAST() Function(). If the window is a child window, then it can be cast to a BBjChildWindow.

In BBj 8.0 and higher, this method can also return a window with a specified name.

Syntax

Return Value

Method

BBjWindow

getWindow(int contextID)

BBjWindow

getWindow(string name)

Parameters

Variable

Description

contextID

Specifies the context ID of a previously created window.

name

Specifies the name of a previously created window.

Return Value

Returns the BBjWindow object associated with the specified context ID or name.

Remarks

In BBj 8.0 and higher, the getWindow(string name) version throws an exception if there are no windows, or more than one window, with the specified name.

Example

REM Obtain an instance of a BBjWindow object

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 common addWindow param values
X=10
Y=10
WIDTH=200
HEIGHT=200
TITLE$="BBjWindow Example"
CONTEXT=10

REM Create a window with a title in the specified context
myWindow! = mySysGui!.addWindow(CONTEXT,X,Y,WIDTH,HEIGHT,TITLE$)

REM Get the window at context 10
CONTENT=10
myWindow! = mySysGui!.getWindow(CONTEXT)

See Also

BBjAPI

BBjWindow

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