Window Management and the EUS Toolkit
Window management is an integral part of the EUS Toolkit programs. It is vital in the integration process that applications use the same method of managing windows. Failure to do so may result in errors and improper screen display.
Before integrating an existing application with the EUS Toolkit, review the Terminal Windowing section in the User's Reference Guide. All of the concepts necessary for understanding how windows are used in PRO/5 are explained in detail.
Avoid using the 'POP' mnemonic in an application that is to be integrated with the Toolkit programs. Instead, use 'DROP' and/or 'GOTO'. When using these mnemonics, the window identifier must be stored. Create a global string that names a window that has just been created and stores its identifier. For example:
PRINT 'WINDOW'(0,0,40,12),
LET TRASH$=FIN(0)
LET TRASH$=STBL("THIS_WINDOW",STR(DEC(TRASH$(9,2))))
To access (THIS_WINDOW), retrieve the identifier from the global string table:
LET THIS_WINDOW=NUM(STBL("THIS_WINDOW"))
PRINT 'GOTO'(THIS_WINDOW)
PRINT 'DROP'(THIS_WINDOW)
LET TRASH$=STBL("!CLEAR","THIS_WINDOW")
If the window identifier is stored in a global string, and the window is DROPped, the global string reference should be removed immediately.
If, in the course of testing or debugging a program, the window display becomes confused, the following console commands can be typed in blind to restore visibility:
PRINT 'BE'
PRINT 'GOTO'(0)
PRINT 'CURSOR'("ON")
Do not use the 'RM' mnemonic to restore a confused system after using windows. This could trap you in a WINDOW other than WINDOW 0.
The zero window cannot be DROPped or POPped. The Toolkit programs will sometimes turn off the cursor and echo; and this behavior should be anticipated when using the Toolkit. The programs will restore the cursor and echo when they have normally terminated.
Remember that using PRINT 'GOTO'(window) does not remove existing windows—it only changes the active window to the specified window.
DROPping windows created by the EUS Toolkit may result in unexpected errors. It is important to use the Toolkit to manage the windows it creates. The most commonly available window is a message window normally created at the bottom of the screen. If this window is left behind by a Toolkit utility, use the _rmmsg.utl utility to remove it. This utility also removes the global string reference to that window, and the Toolkit programs will not assume it still exists.
Window names should be unique to avoid overwriting existing identifiers with new ones. Avoid using names that begin with "#" because many Toolkit programs create STBL() entries that begin with this character.