FutureBasic Logo

<<    Index    >> FutureBasic 5

FlushWindowBuffer   statement

FlushWindowBuffer [ wNum | _FBAutoFlushOff | _FBAutoFlushOn ]

Under MacOS 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 wNum is omitted, or is 0, the current output window is flushed by the MacOS X Window Server. If wNum is non-zero, window wNum 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 wNum. FlushWindowBuffer _FBAutoFlushOn will restore the automatic flushing.
The FlushWindowBuffer command has no effect unless the program is running under MacOS X. Because of coalesced updates in MacOS X 10.4 Macho-O binaries, this does nothing if called too soon (0 or 1 tick) after the previous call.


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

window 1
plot 0,0 to 500,500


until fn button // wait for mouse-down