Stopping calling program from being close when there are other programs open in the c

Hi,

Under V9.1D (service patch 1) using GUI and smart objects.


If I have a program/container which in turn calls another program/container which in turn calls another program/container etc

how do I stop the user from closing down the original program and hence leaving the called programs in a sort of limbo ?



:blue:
 

bendaluz2

Member
Easiest way is to disable the close button.

See http://www.global-shared.com/api for instructions on how to do this

Another way is to have a temp-table in a persistent procedure, and each time you create a new window, store its handle in the table. Then, when the top level program closes, you can go through the table and close all the windows expilicitly.

Also, when the child window is created, I would disable all the widgets on the parent window, and then re-enable them when the child closes, unless you need multiple children of course.
 

Don Carlson

New Member
Another good way to handle this is through the use of PUBLISH and SUBSCRIBE statements. Have each child program/container subscribe to a "SHUTDOWN" event, write the trigger code for the "SHUTDOWN" event (i.e. APPLY "CLOSE" etc.) and then add a PUBLISH "SHUTDOWN" statement to your shutdown trigger on the original program. When the user closes the original program, it PUBLISHES the SHUTDOWN event and all children programs gracefully shutdown along with it.

Should do the trick!

Don Carlson, Programmer
Computer Software Associates, Inc.

Originally posted by Mike Clark
Hi,

Under V9.1D (service patch 1) using GUI and smart objects.


If I have a program/container which in turn calls another program/container which in turn calls another program/container etc

how do I stop the user from closing down the original program and hence leaving the called programs in a sort of limbo ?



:blue:
 
Top