Consultor Eletrônico



Kbase P107801: Widgets LEAVE trigger doesn't fire when closing the window from the "X" button
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x

SYMPTOM(s):

Widgets LEAVE trigger doesn't fire when closing the window from the "X" button

The window procedure is launched persistent from another procedure

The LEAVE trigger fires when the window is run persistent directly from AppBuilder

LEAVE trigger fires when the window isn't persistent

CAUSE:

The WINDOW-CLOSE trigger has an APPLY "CLOSE" to THIS-PROCEDURE. When running the procedure either non-persistently or through the AppBuilder tool, the code will WAIT-FOR on the "CLOSE" of the procedure.

When processing an event, the Progress client checks if it satisfies a WAIT-FOR and sends a LEAVE event to the current object with focus. That's why you see the leave trigger being fired in those two cases ( the APPLY "CLOSE" satisfy the WAIT-FOR).

However, when running from another procedure or through Pro*Tools persistently, the code does not wait on the close of the procedure executing:, therefore when we process the CLOSE of the procedure, we won't fire the leave event since it does not satisfy any WAIT-FOR.

If you run the code like this:

DEF VAR h AS HANDLE.
RUN c-win.w PERSISTENT SET h.
/* wait for the close of the persistent procedure */
WAIT-FOR CLOSE OF h.

Then the leave trigger will fire.


However, in a multiple window application, it should be only one WAIT-FOR so the above code cannot be used.
Programs just shouldn't rely on the widgets LEAVE trigger to fire when closing the window.