OPENWINDOW

Top  Previous  Next

Syntax

INT = OPENWINDOW(win as WINDOW,l as INT,t as INT,w as INT,h as INT,flags as UINT,parent as POINTER,title as STRING,procedure as UINT)

Description

Creates a new window.

Parameters

win - WINDOW variable.

l, t, w, h - Position and dimensions of new window.

flags - Style flags of window.

parent - Windows parent or NULL.

title - Caption text for window.

procedure - Address of subroutine to process messages for this window.

Return value

Returns 0 on failure, 1 if window was successfully created.

Remarks

See Also: CLOSEWINDOW, Creating Windows

Example usage

REM define a window variable
DEF w1 as WINDOW
REM open the window
OPENWINDOW w1,0,0,350,350,@MINBOX|@MAXBOX|@SIZE,0,"Simple Window",&main
REM print a message
PRINT w1,"Hello World"
REM when w1 = 0 the window has been closed
WAITUNTIL w1 = 0
END
'---
REM every time there is a message for our window
REM the operating system will GOSUB here
SUB main
    IF @CLASS = @IDCLOSEWINDOW
        REM closes the window and sets w1 = 0
        CLOSEWINDOW w1
    ENDIF
RETURN
ENDSUB