Device()

Selects and controls graphics devices

DEVICE/OPEN [devtype=String] [width=Real] [height=Real] Opens a graphics device for plotting on
DEVICE/CLEAR   Clears the current graphics device
DEVICE/CLOSE   Close the current graphics device
DEVICE:STATUS()   Returns $TRUE if there is a device open

example:

	# Open two X-Windows display devices
	# and close one.
	>> device/open "XW" height=5.0
	>> dev2 = device:open("XWINDOW",height=3.0)
	>> select dev2
	>> device/close

Note: For windowing systems, multiple device may be open at once.

Device/Open

The supported interactive devices on most machines include "XWINDOWS" X-Windows and "TEK4010" Tek 4010 compatible. The supported non-interactive devices include "PS" Postscript, "CPS" Colour Postscript and "HPGL" HPGL driver for 7475A For full details of supported devices on each machine see Supported Graphics Devices.

Parameters:

Devtype (String) [ default = "XWINDOW" ]

The device name string, this can be any supported device, interactive or hardcopy. Only one device can be open at any one time.

Width (Real) [ default = 8.0 inches ]

Width of the graphics display in inches.

Height (Real) [ default = 8.0 inches ]

Height of the graphics display in inches.

RESULT = (Device)

Returns the device object for later reference.

Device/Clear

Clears the display surface on the currently open device or advances to a new sheet of paper, a new picture is created automatically and will become the current picture. The older pictures will still be available by using the Redraw() command (Redraw pic(-1) will redraw the picture before the device was cleared).

Device/Close

Deactivates the currently open graphics device. This command flushes output to a file when using a hardcopy device and must be called before the file can be used. Once the device is closed, it is not possible to draw anything without re-opening the device. A different device can be used when the device is re-opened.

Parameters:

Object (Gobject)

Optional device to close, otherwise the default is to close the current device.

Device:Status()

Returns true if there is at least one graphics device open. This can be useful where another procedure may or may not have initialized the graphics system previously and it would be unnecessary or unhelpful to open a second device.