GRAPHIC WINDOW statement  

Purpose

Create a new graphic window.

Syntax

GRAPHIC WINDOW caption$, x&, y&, nWidth&, nHeight& TO hWin???

Remarks

After a graphic window has been created, GRAPHIC ATTACH is used to choose it as the selected graphic target.  You can then draw text, lines, circles, and other forms with various graphical statements.  Due to the nature of a GRAPHIC WINDOW and its contents, it may not be resized.  If a new size is needed, it should be destroyed and recreated.

GRAPHIC WINDOW END can be used to close and destroy the selected Graphic window at any time.  Otherwise, the window is automatically destroyed when the program ends.

All PowerBASIC graphical displays are persistent -- they are automatically redrawn for you after resuming from being minimized or temporarily covered by other windows.

caption$

The text to be displayed in the title or caption bar of the graphic window.  If caption$ is empty (zero-length), the window is displayed without a title bar, so the appearance is different and the window cannot be dragged by the user.

x&, y&

The location of the window, in pixels, relative to the upper left corner of the screen.

nWidth&

The width of the client area of the window, not including the frame.  The width is specified in pixels.

nHeight&

The height of the client area of the window, not including the frame.  The height is specified in pixels.

hWin???

The handle of the newly-created window.  If the window could not be created, hWin??? will be 0.

See also

CONTROL ADD GRAPHIC, GRAPHIC ATTACH, GRAPHIC DETACH, GRAPHIC WINDOW END, GRAPHIC WINDOW CLICK

Example

FUNCTION PBMAIN () AS LONG

  ' Create and show a Graphic window on screen

  LOCAL hWin AS DWORD

  GRAPHIC WINDOW "Box", 300, 300, 130, 130 TO hWin

  GRAPHIC ATTACH hWin, 0

  GRAPHIC BOX (10, 10) - (120, 120), 0, %BLUE

  SLEEP 5000  ' show it for 5 seconds, then end

END FUNCTION