Contents Previous Next Subchapters

Using Identifier To Switch Between Graphic Windows
Syntax gwin
gwin(
identifier)
See Also gaddwin , glistwin , gwin

Description
If identifier is not present, returns the integer scalar identifier for the current graphic window. If identifier is present, sets the current graphic window to the one specified by identifier, where identifier is an integer scalar.

Example
If you enter
     ginit
     gaddwin("My Graphic")
O-Matrix will respond
     1
in the Command window because this is the identifier for the new graphic window. If you then enter
     gwin
O-Matrix will respond
     1
because this the identifier for the current graphic window. If you then enter
     gwin(0)
     gplot(seq(5))
O-Matrix will draw a plot in the Graphic 0 window (which has the 0 identifier). If you then enter
     gwin(1)
     gplot(seq(5))
O-Matrix will draw a plot in the My Graphic window (which has the 1 identifier).

If you click on a graphics window with the mouse, O-Matrix will automatically generate the appropriate gwin command for that window. For example, if you continue the example above by clicking on the Graphic 0 window, and then entering
     gtitle("Viewport Title")
the title will be written in the Graphic 0 window.