WAIT-FOR CLOSE (execute window and wait until it has finished)

Hi,

I'm work with Progress Openedge 10.1A.

To mimic a Modal call i'm run a persisten window and put sensitive = false the source window.

For example:

def var h_container as handle no-undo.
def var h_window as handle no-undo.

h_container = current-window.

h_container:sensitive = false.

run window.w persistent set h_window.
run inicializeObject.
wait-for close for h_window.

h_container:sensitive = true.

This work ok, but if the user open more than one window and close windows in an order different from the establishment, the pointer is missing and windows don't execute sensitive = true.

The result is windows are died and don't enabled.

Anybody know a solution?

I need the windows environment mimicking a multithread system and modal behavior.

Sorry for my English :P


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

use the timer OCX

To mimic multithread in our system, we had to use the timer OCX to start the windows.
Logic:

user does an action that should pop a new window, we set a global parameter (variable defined in the program header) containing info about the window (program) to pop, we start the timer (it has a tick time of maybe 100 millisec), the timer enters it's Tick event, disables itself and runs the window (persistent) according to the info stocked in our global variable. The started window has to PUBLISH a "Close" event that tells the caller that it has returned. The caller has a list of the started procedures, it removes this one from the list and can do any other logic (it could be to re-sensitize the caller).
There's a saying in Progress: One world, one wait-for. Maybe it has to do with situations like this :)