%lw - Leave Window Open


To allow winio@ to return without closing the window that it creates.


winio@('%lw[option]', ctrl)
integer ctrl     (output)


Grave accent (`) - used to delay the creation of the window until ctrl has been passed to %ch (Child Window).


Using %lw causes winio@ to return whilst leaving the window open. ctrl is a control variable that is returned with the value -1. Subsequently the window can be closed by setting ctrl to zero (or a positive value) and calling WINDOW_UPDATE@(ctrl). Setting ctrl to -2 will cause the window to close after after a short delay. This can be used to seamlessly modify a window by closing the window and then recreating it with similar features and the same position and size.

%lw can take the option owned ( %lw[owned] ). This option defines certain properties of the window in relation to its parent. The "owned" properties are those of a window that does not use %lw, namely that the parent cannot overlay the child and, if the parent is closed, the child automatically closes. For these properties to be meaningful the parent must be created using %ww (Window Style). Also %lw[owned] must be used in the definition of a child window that appears in a call-back function of the parent.


If the control variable is declared within a subroutine then it is usually necessary to give it the SAVE attribute. Alternatively %lw can be combined with %wt which ensures that the process of closing the window is completed before returning control to the caller.

See also

%ch (Child Window), Leaving windows open, STOP_WHEN_WINDOWS_CLOSE@




Copyright © 1999-2024 Silverfrost Limited