Responding to Screen Size and Colors

The usability of your application may depend on responding to settings on the user's system.

Finding Screen Size

Use the GET_SCREEN_SIZE function to determine the size of the screen on which your application is displayed. Writing code that checks the screen size allows your application to handle different screen sizes gracefully.

Number of Colors Available

Use the N_COLORS and TABLE_SIZE fields of the !D system variable to determine the number of colors supported by the display and the number of color-table entries available, respectively.

Make sure that your application handles relatively small numbers of colors (less than 256, say) gracefully. For example, Microsoft Windows reserves the first 20 colors out of all the available colors for its own use. These colors are the ones used for title bars, window frames, window backgrounds, scroll bars, etc. If your application is running on a Windows machine with a 256-color display, it will have at most 236 colors available to work with.

Similarly, make sure that your application handles TrueColor (24-bit or 32-bit color) displays as well. If your application uses IDL's color tables, for example, you will need to force the application into 8-bit mode using the command

DEVICE, DECOMPOSED=0 

to use indexed-color mode on a machine with a TrueColor display.