The simplest example of an action on the WINDOW-CLOSE event is this:

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

If the WAIT-FOR statement is the last executable statement in a nonpersistent procedure, the event satisfies the WAIT-FOR and the procedure terminates.

The AppBuilder window template uses indirection to direct the WINDOW-CLOSE event for the window to the procedure itself, using this standard ON WINDOW-CLOSE trigger:

DO:
  /* This event will close the window and terminate the procedure. */
  APPLY "CLOSE":U TO THIS-PROCEDURE.
  RETURN NO-APPLY.
END.

You already saw the rest of the steps in this sequence, with the CLOSE event on the procedure running disable_UI and deleting the procedure itself.