Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

Icon Associations

To enable quicker object recognition, you can associate icons with:

Specifying Icon Files

For icons used for actions, data types, and in the Front Panel or subpanels, specify only the base name of the icon (no suffixes). The correct suffixes are added automatically based on your display resolution, color support, and File Manager view options (such as By Small Icons).

To override the search path, provide the complete path and name of the icon.

To Associate an Icon with an Action or Data Type

  1. Specify the icon using the ICON field.

    If you follow the appropriate naming conventions for icon files, specify only the base name of the icon. The correct icon will be displayed based on the resolution and color support of your display.

  2. Create the following icon sizes:

    • Actions: large, medium, and tiny

    • Data types: medium and tiny

Example of an Action Definition

The following example is an action definition for starting the Island Paint drawing tool. The icons Ipaint.l and Ipaint.s are associated with the action.

ACTION	IslandPaintOpenDoc
{
 	WINDOW_TYPE				NO-STDIO
 	ICON						Ipaint
 	EXEC_STRING    		/usr/bin/IslandPaint %Arg_1"File to open:"%
 }

If you are using color icons, the desktop first appends .pm when looking for the actual icon files. Otherwise (or if no match is found with .pm), the desktop appends .bm.

Example of Data Type Definition

The following data type definition associates the icons comprsd.l and comprsd.s with compressed files:

DATA_ATTRIBUTES  COMPRESSED
{
		ICON					comprsd
 	ACTIONS				Uncompress
 	DESCRIPTION			A COMPRESSED file has been compressed by the \
 							'compress' command to take up less space.
} 

To Display an Icon in a Front Panel Control

  1. Specify the image name using the ICON field.

    If the control monitors a file (MONITOR_TYPE is set to mail or file), use the ALTERNATE_ICON field to specify the icons used when the change is detected.

    You can also provide animation for buttons and drop zone controls.

  2. Create the following icon sizes:

    • Front Panel and subpanels: large, medium, and tiny

    • Workspace switch: small

Example

The following control changes appearance when a file named report is placed in the /doc/ftp/pub/ directory. When the file is not there, the NoReport.pm icon is displayed; when the file is there, Report.pm is displayed.

CONTROL MonitorReport
 {
 	CONTAINER_NAME				container_name
 	TYPE							ICON
     MONITOR_TYPE				file
 	FILE_NAME					/doc/ftp/pub/report
 	ICON							NoReport
 	ALTERNATE_ICON				Report
 }

To Associate an Icon with an Application Window

  1. Set the iconImage resource for Workspace Manager as follows:

    Dtwm*clientname*iconImage: icon_file_name

    To determine the correct value for clientname, open Application Manager and double-click Window Properties in the Desktop_Tools application group. When you select a window, its properties are listed. The WM_CLASS property displays the window's class name in quotes.

    For more information about setting resources, see Setting Application Resources.

  2. Choose Restart Workspace Manager from the Workspace menu.

    To verify that the icon has been recognized by Workspace Manager, minimize the window whose icon you are trying to modify.


    Note –

    Some applications do not allow their default window icon to be overridden.


To Use File Manager as an Icon Browser

  1. Copy the file /usr/dt/examples/language/IconBrowse.dt to the HomeDirectory/.dt/types/Iconbrowse.dt directory.

  2. Open Application Manager and double-click Reload Actions in the Desktop_Tools application group.

    When you change to a directory that contains icons (.bm and .pm files), each icon is displayed next to its name. For example, if you change to the /usr/dt/appconfig/icons/language directory, you will see many of the desktop icons.


    Note –

    Enabling icon browsing on low-memory systems may cause File Manager to display directories more slowly. Images larger than 256 x 256 are not displayed in the default configuration.


    To disable icon browsing:

  1. Remove your personal copy of the IconBrowse.dt file.

  2. Open Application Manager and double-click Reload Actions in the Desktop_Tools application group.