Futurebasic/Language/Reference/flushwindowbuffer

FLUSHWINDOWBUFFER statement edit

FLUSHWINDOWBUFFER edit

Statement edit

✔ Appearance ✔ Standard ✔ Console

Syntax edit

FLUSHWINDOWBUFFER [{wRef | {_FBAutoFlushOff |_FBAutoFlushOn}]

Revised edit

April 2003 (Release 8)

Description edit

Under OS X, all drawing to a window is intercepted and stored ("buffered") by the Window Server. The Window Server normally transfers the drawing to the screen only when your program executes a HANDLEEVENTS statement. You can force an early update with FLUSHWINDOWBUFFER.

If wRef is omitted, or is 0, the current output window is flushed by the OS X Window Server. If wRef is non-zero, window wRef is flushed.

The default behavior of the FutureBASIC runtime is to flush the current output window each time a PRINT statement is performed. You can control that behavior: FLUSHWINDOWBUFFER _FBAutoFlushOff will turn off the automatic flushing. You still can force the flushing for a specific window with FLUSHWINDOWBUFFER wRef. FLUSHWINDOWBUFFER _FBAutoFlushOn will restore the automatic flushing.

The FLUSHWINDOWBUFFER command has no effect unless the program is running under OS X.

Example:

// In this example, there is no HandleEvents,
// and so FlushWindowBuffer is needed to
// make the drawing visible under OS X.

WINDOW 1
PLOT 0,0 TO 500,500

FLUSHWINDOWBUFFER

DO
UNTIL FN BUTTON // wait for mouse-down