SetScreen TCL UTILITIES USER MANUAL SetScreen
SYNOPSIS
Select a canvas for output
PACKAGE
TCLGPH
NAME
SetScreen
USAGE
SetScreen  canvasID {Canvas}
INPUT DEFINITIONS
canvasID - The current canvas iD. If no canvas has been created with this iD the routine will create one.
Canvas - Optional input variable which informs the device initialization routine not to open a canvas but to use one which has been externally opened. The default setting is NONE which causes the routine to create a graphics canvas when invoked. To use an externally created canvas enter the canvas window name here.
RETURN DEFINITION
NONE
DESCRIPTION
SetScreen sets the current output canvas. If the output canvas has not yet been created the the routine will create it or assign it to an externally created canvas depending on Canvas. A created canvas is created according to the setting of the external variables GphInfo(xsScrL), GphInfo(ysScrL), GphInfo(xScrL), GphInfo(yScrL) where xsScrL and ysScrL set the X and Y pixel lengths of the canvas while xScrL and yScrL set the X and Y pixel lengths of the displayed canvas. If the canvas size is larger than the displayed canvas, scroll bars are added to the display. If the external variables are not defined the canvas is defaulted to 750x500 pixels.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Set up two canvas's, with two different sizes and backgrounds. Set a graphics window up in each and outline them.
# 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 but don't create a canvas

GraphicsOn TK ETones NOSWAP NONE OMIT

# SET a blue background and initialize the canvas

BackGround $GphInfo(Blue)
SetScreen 0

# SET a long narrow window 

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

# SET a green background and initialize a second canvas

 BackGround $GphInfo(Green)
 SetScreen 1


# SET current line color to red

PlotColor HOLD $GphInfo(Red) OFF

# PUT canvas 0 as the current canvas, create a graphics window and outline 
#   the window

SetScreen 0
GenWindow 0 .25 .25 0.0 .75 .75 0.0 0.0 0.0 0.0 1.0 1.0 0.0 
Box 0 0.0 0.0 0.0 1.0 1.0 0.0

# PUT canvas 0 as the current canvas, create a graphics window and outline 
#   the window

SetScreen 1
GenWindow 2 .25 .25 0.0 .75 .75 0.0 0.0 0.0 0.0 1.0 1.0 0.0 
Box 2 0.0 0.0 0.0 1.0 1.0 0.0

# Outline window 2 on canvas 0 in white to see where it is

SetScreen 0
PlotColor HOLD $GphInfo(White) OFF
Box 2 0.0 0.0 0.0 1.0 1.0 0.0
      
      
Feb 26, 2007