G2 displays a window, using these defaults:
-magnification command line option specifies the default magnification for KB workspaces at full scale. The optional -resolution command line option informs a G2 process about the resolution (in pixels per inch) of the monitor on which the window appears. Together, these options determine the absolute size at which G2 displays a window on a given display device for a given platform. By combining the settings of these two options properly, you can launch G2 processes on different computers having display devices of different resolutions and display the same KB at the same (or very nearly the same) absolute size. Alternatively, by specifying other settings in these options, you can launch a G2 process that displays a KB at the highest resolution allowed on a particular display device.
-resolution and -magnification command line options resolution, and magnification.
For example, if you use this command to launch a G2 process:
g2 -resolution 75 -magnification 1.0
g2 -resolution 100 -magnification 0.75
g2-window-height and g2-window-width attributes report the dimensions (in workspace units) of the G2 window. These attributes are read-only, but you can refer to them in expressions. For example, this show action displays a KB workspace at a scale that has a particular ratio of height to width:
{ Scale a kb-workspace on a g2-window of arbitrary size
to maintain the same relative size as if displayed on a window
of 1036 by 810 workspace units. }
show help-workspace scaled by its current scale times
min ( ( the g2-window-width of this window / 1036 ) ,
( the g2-window-height of this window / 810 ) )
g2-window-height and g2-window-width attributes of a new G2 window associated with a local window by using the -height and -width command line options. For more information about these options, see height and width.
Otherwise, G2 automatically updates these attributes whenever you use the host window manager to resize the local or remote window associated with the G2.
Tip: When you launch a G2 process, you can specify the -fullscreen command line option to display the new G2's local window at full-screen size.
Identifying the Resolution of G2's Window
The g2-window-x-resolution and g2-window-y-resolution attributes report the resolution (in pixels per inch) at which G2 displays the window associated with this g2-window item.
Note: These attributes are read-only. The associated window's resolution does not change during the window's existence.
You can initialize the g2-window-x-resolution and g2-window-y-resolution attributes of a new g2-window item associated with a local window by using the -resolution command line option, or by using the -x-resolution and -y-resolution pair of command line options.