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.