Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Window Objects


Objects of the IDLgrWindow class represent a rectangular area on a computer screen into which graphics hierarchies can be rendered. Window objects can be either stand-alone windows on the screen or drawable areas in an IDL draw widget.

Creating Window Objects

There are two ways to create window objects: directly via the window object's Init method and indirectly by creating a draw widget that uses a window object as its drawable area.

Using the Init Method

The IDLgrWindow::Init method takes no arguments. Use the following statement to create a window object:

myWindow = OBJ_NEW('IDLgrWindow') 

The window is displayed on the screen as soon as it has been created.

Creating a Draw Widget that Uses a Window Object

To create a draw widget that uses an Object Graphics window object rather than a Direct Graphics window for its drawable area, set the GRAPHICS_LEVEL keyword to the WIDGET_DRAW function equal to 2:

drawwid = WIDGET_DRAW(base, GRAPHICS_LEVEL=2) 

Once the draw widget has been realized, you can then retrieve the object reference to the draw widget's window object using the WIDGET_CONTROL procedure:

WIDGET_CONTROL, drawwid, GET_VALUE=myWindow 

Color Model

By default, window objects use the RGB color model. To create a window that uses the Indexed color model, set the COLOR_MODEL property of the window object equal to 1 (one) when creating the window:

myWindow = OBJ_NEW('IDLgrWindow', COLOR_MODEL=1) 

You cannot change the color model used by a window after it has been created.

See the "Working with Color" chapter of the Image Processing in IDL manual for a discussion of the two color models.

Hardware vs. Software Rendering

The RENDERER property to the IDLgrWindow object (and the preference of the same name in the IDL Development Environment) allows you to select between the operating system's native (hardware) rendering system and a platform independent (software) rendering system for IDL Object Graphics displays.

Hardware rendering allows IDL to make use of 3D graphics accelerators that support OpenGL, if any are installed in the system. In general, such accelerators will provide better rendering performance for many object graphics displays

The software rendering system will generally run more slowly than the hardware rendering system. However, use of the software rendering system has a few important advantages:

Note on Window Size Limits

The OpenGL libraries IDL uses impose limits on the maximum size of a drawable area. The limits are device-dependent - they depend both on your graphics hardware and the setting of the RENDERER property. Currently, the smallest maximum drawable area on any IDL platform is 1280-by-1024 pixels; the limit on your system may be larger.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]