BBjMDI::countClients

Description

In BBj 3.0 and higher, this method returns the number of active clients within the BBjMDI window.

Syntax

Return Value

Method

int

countClients()

Parameters

None.

Return Value

This method returns the current number of clients that are in the MDI window.

Remarks

None.

Example

rem 'countClients.bbj

open (unt)"X0"

rem 'retrieve the MDIProxy
bbj! = BBjAPI()
MDI! = bbj!.getMDI()

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

rem 'add menu items to the MDI Window
menuBar! = mdi!.addMenuBar()
AMenu! = menuBar!.addMenu(20,"menu")
MenuItem201! = AMenu!.addMenuItem(201, "SCALL bbj")
mdi!.enableMDIWindowMenu()

rem 'set callbacks
MenuItem201!.setCallback(menuBar!.ON_MENU_ITEM_SELECT, "selected_201")
CALLBACK(ON_CLOSE,APP_CLOSE,mdi!.MDI_CONTEXT)

rem 'Process Events
process_events

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
    print "current number of clients: " , mdi!.countClients()
    if mdi!.countClients() = 0
        release
    endif
return

selected_201:
    a = scall("bbj &")
return

See Also

BBjAPI

BBjMDI

Object Variables

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