W_INIT

Initialize the windowing system

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall W_INIT(arg_1, channel, max_windows[, #rows, #cols][, init_size])

Arguments

arg_1

A numeric expression that serves as a placeholder. (Previously. this argument contained the number of bytes of memory allocated for window processing. Because the windowing subroutines no longer require a window memory pool, this argument is no longer used, but must still be passed.) (n)

channel

An expression that contains the channel you have opened for terminal output. If the channel is not open or has a value of 0, the default TT: runtime internal channel is used. On .NET this argument is ignored. (n)

max_windows

An expression that contains the maximum number of windows that can be active simultaneously. This argument has no upper limit. It causes four bytes to be reserved in memory for each window. For example, if the maximum number of windows is 15, 60 bytes is reserved in memory. (n)

#rows

(optional) An expression specifying the initial number of rows in the display screen. (n)

#cols

(optional) An expression specifying the initial number of columns in the display screen. (n)

init_size

(optional) An expression that is returned with a value of zero if the windowing system has not been previously initialized or with arg_1 if the windowing system has already been initialized. (n)

Discussion

W_INIT initializes the windowing system. It must call it before any other window processing occurs.

In a bound program, you don’t need to initialize the windowing system more than once, but the same channel must be open to the terminal in each program. If init_size is passed and the windowing system has already been initialized, the windowing system is not reinitialized.

If #rows and #cols are not specified, the screen size will be the default for the given platform. On Unix, OpenVMS, and .NET terminal apps, the default is 80 X 24. In .NET Framework and .NET 6.0 Windows, the default is 80 x 25. In traditional Synergy for Windows, it’s also 80 x 25, unless these defaults are overridden by the APP_WIDTH or APP_HEIGHT initialization settings.

W_INIT interprets the DBL_CHRSET environment variable, if it exists, to set an alternate language character set.

Important

If a program using windowing subroutines chains to another program using windowing subroutines that call W_INIT again, the window set-up is lost. You must set up your windowing system in each program.

Examples

In the example below, we declare WNDCHNL and MAXWINS as constants with the .DEFINE statement. The channel argument (WNDCHNL) in the W_INIT call must be the same as the channel opened to the terminal in the OPEN statement. The program tests whether the windowing system has been initialized, and if it hasn’t, the program creates its windows.

.define MAXWINS,        5
.define WNDCHNL,        1
.include "WND:windows.def"
record
    init                ,d5
proc
    open(WNDCHNL, o, "tt:")
    xcall flags(7004020, 1)
    xcall w_init(1, WNDCHNL, MAXWINS,,,init)
    if (.not.init)
      xcall create_wnds
      .
      .
      .