BB___REDRAW

=REDRAW= toc

Description
> In a graphics window or graphicbox, REDRAW //refreshes// the screen, causing flushed drawing segments to be redrawn. Caution - Any drawn items that have not been flushed will not be redrawn and will be lost.

> Some additional commands used with the display of graphics: >> segment >> delsegment >> cls >> discard >> flush

Syntax
> //This command is NOT case sensitive//. Redrawing all undeleted segments: Redrawing a segment by its named ID number: Redrawing a segment by name:
 * 1)  - a graphics window
 * 2)  - a graphicbox

Hints

 * //**Retrieving idNum.**// See segment for how to retrieve segment id numbers.
 * //**Segment name.**// See flush for how to save and name the current segment.
 * //**Display order.**// Redrawing all undeleted segments will place the segments in the original order in which they were drawn. (This is called the Z order). Redrawing a named segment will place that segment to the front of the screen.

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

WindowWidth=400 WindowHeight=300

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

'put the pen down and place it   #g "down; place 200 130" 'draw a green circle #g "color green; backcolor green; circlefilled 50" 'save work so far #g "flush circle" 'change color and draw a box #g "color red; size 2; place 140 70" #g "box 260 190" 'save the box #g "flush box"

'draw an ellipse but don't flush the current segment #g "home; color blue; backcolor blue; ellipsefilled 50 25"

confirm "Do you want to remove the circle?"; yn$ if yn$="yes" then #g "delsegment circle"

'issue a redraw to update the display #g "redraw" 'notice that the ellipse was not redrawn because ' that segment was not flushed

'make graphics stick #g "flush"

wait

[quit] close #g end code

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