ClearWindow TCL UTILITIES USER MANUAL ClearWindow
SYNOPSIS
Clear a graphics window
PACKAGE
TCLGPH
NAME
ClearWindow
USAGE
ClearWindow  wnID {Color}
INPUT DEFINITIONS
wnID - The iD of the window to clear.
Color - Optional input variable which allows the window background to be set to a color other that the canvas background color. The default is -1 to set to the canvas background color. When active the value must be between 0 and 255 which is an offset into the color table.
RETURN DEFINITION
NONE
DESCRIPTION
ClearWindow clears the window associated with wnID. The window is cleared to the canvas background color unless Color is set to a non-negative value between 0 and 255.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Clear one of 1 windows.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# START graphics

GraphicsOn TK RainBow SWAP

# SET UP 4 windows on the canvas.

GenWindow  0 0.0 0.0 0.0 0.48 0.48 0.0 -5.0 -5.0 0.0 5.0 5.0 0.0 
GenWindow  1 0.0 0.52 0.0 0.48 1.0 0.0 -5.0 -5.0 0.0 5.0 5.0 0.0 
GenWindow  2 0.52 0.0 0.0 1.0 0.48 0.0 -5.0 -5.0 0.0 5.0 5.0 0.0 
GenWindow  3 0.52 0.52 0.0 1.0 1.0 0.0 -5.0 -5.0 0.0 5.0 5.0 0.0 

# SET line color to green

PlotColor HOLD $GphInfo(Green) OFF

# OUTLINE EACH WINDOW

Box 0 -5.0 -5.0 0.0 5.0 5.0 0.0
Box 1 -5.0 -5.0 0.0 5.0 5.0 0.0
Box 2 -5.0 -5.0 0.0 5.0 5.0 0.0
Box 3 -5.0 -5.0 0.0 5.0 5.0 0.0

# IDENTIFY EACH WINDOW

TexT 0 0.0 0.0 0.0 center "WINDOW 0" $GphInfo(Red)
TexT 1 0.0 0.0 0.0 center "WINDOW 1" $GphInfo(Red)
TexT 2 0.0 0.0 0.0 center "WINDOW 2" $GphInfo(Red)
TexT 3 0.0 0.0 0.0 center "WINDOW 3" $GphInfo(Red)

# PAUSE graphics

ShowScreen

# CLEAR WINDOW 3

ClearWindow 3
      
      
March 2, 2007