| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (9 out of 13)

Specifying the Appearance of G2's Window

Each g2-window item has read-only attributes that report the associated window's height and width in pixels, resolution in pixels per inch, and magnification.

G2 displays a window, using these defaults:

You can initialize these attributes by specifying command line options when you launch a new G2 process or Telewindows process.

Specifying the Resolution and Magnification

The -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.


Tip: For a description of the -resolution and -magnification command line options resolution, and magnification.

For example, if you use this command to launch a G2 process:

it is equivalent to this command line:


Tip: For best results, consider the dot pitch (that is, the ratio of width to height) of the pixels produced on the display devices on your G2 application's delivery platform.

Identifying the Dimensions of G2's Window

The 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:

You can initialize the 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.

See also Appendix A, Launching a G2 Process for more information about these options.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (9 out of 13)

Copyright © 1997 Gensym Corporation, Inc.