BBjMDI::closeAllClients

Description

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

Syntax

Return Value

Method

boolean

closeAllClients(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

This method calls into any callback that was registered through a call to BBjMDI::registerMDIClosingCallback. If any of these callbacks invokes the method BBjMDI::vetoMDIClose, then this method will be deemed unsuccessful. If the timeout period expires before all MDI clients have responded, then an error will be thrown. As opposed to the method BBjMDI::closeAll, this method does not close the MDI window itself.

Example

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

open (unt)"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::closeAll

Object Variables

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