BBjMDI::closeAll

Description

In BBj 3.0 and higher, this method attempts to close the BBjMDI window and any MDI client programs currently running within the BBjMDI window.

Syntax

Return Value

Method

boolean

closeAll(int timeoutInSeconds)

Parameters

Variable

Description

timeoutInSeconds

The number of seconds the MDI will wait before generating an !ERROR=60 - General I/O Error.

Return Value

0 = A client registered as a MDI close listener vetoed the operation.

1 = Successful operation.

Remarks

Before closing the MDI window, this method will first call into any callback that was registered through a call to BBjMDI::registerMDIClosingCallback. If any of these callbacks invokes the method BBjMDI::vetoMDIClose, then the MDI window will not be closed. If the timeout period expires before all MDI clients have responded, then the MDI window will not be closed.

In BBj 3.0 and 3.01, the closeAll() performs and implicit RELEASE. As of BBj 3.02, there is no longer an implicit RELEASE in closeAll()
.

Example

rem 'MDI.closeAll(x) and MDI.closeAllClients(x)

sysgui = unt
open(sysgui)"X0"
MDI! = BBjAPI().getMDI()

rem 'create an MDI Window
mdi!.createMDIWindow(50, 50, 800, 600, "MDI Window")

rem 'callback for clicking the 'X'
CALLBACK(ON_CLOSE,APP_CLOSE,mdi!.MDI_CONTEXT)
mdi!.setVisible(1)
X$ = "bbj namespace.bbj -tT1 &"; REM ---namespace.bbj can be found in docs at BBjMDI.vetoMDIClose()load
a = scall(x$)
a = scall(x$)
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
    print(0)'FOCUS'(0); input "1 for Clients, 2 for Client&Master, 3 for timed C&M: ",z
    if(z = 1) res= mdi!.closeAllClients(0); goto LAB; REM CLOSE CLIENTS, WAIT FOREVER
    if(z = 2) res= mdi!.closeAll(0); goto LAB; REM CLOSE CLIENTS AND MASTER, WAIT FOREVER
    if(z = 3) res= MDI!.closeAll(5); goto LAB; REM CLOSE CLIENTS AND MASTER, WAIT 5 SECONDS
    LAB: ?"closeAll: RES: =",res;if(res = 1) escape
return

See Also

BBjAPI

BBjMDI

BBjMDI::closeAllClients

Object Variables

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