BB___FLUSH

=FLUSH= toc

Description
> For use with graphics windows and graphicboxes, FLUSH saves a list of the drawing commands so they will persist whenever your graphics window is minimized, covered over, or resized. Without a flush command, any of those actions could cause the graphics to be 'lost'. The flush process is often called 'sticking' the graphics.

> FLUSH also creates a new current drawing segment and gives it the next higher ID number.

> Some commands used when 'sticking' graphics are: >> segment >> delsegment >> cls >> discard >> redraw

Syntax
> //This command is NOT case sensitive.//
 * 1)  - a graphics window
 * 2)  - a graphicbox

Hints
> Often, you will not be concerned with a segment name. For example, you may only want to be sure that the fill color of the graphics window is preserved if a user minimizes it. In that case, all you need to do is flush the graphics. At other times, you may want to refresh the window with a particular group of graphics, say with game play. These commands assign a name to the group of graphics that are flushed so you can refer to the group at any time.
 * 1)  - a graphics window
 * 2)  - a graphicbox

Example
An example of the command in a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Flush Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down #g "down; place 10 10" 'draw a blue box #g "backcolor blue" #g "boxfilled 100 100"

'make graphics stick #g "flush"

wait

[quit] close #g end code

An example of the command in a graphicbox. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

graphicbox #g.gb 0, 0, 390, 270 open "Flush Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down #g.gb "down; place 10 10" 'draw a blue box #g.gb "color blue" #g.gb "box 100 100"

'make graphics stick #g.gb "flush"

wait

[quit] close #g end code

Useful Functions
code format="lb" Place a useful function using this keyword here code