Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 14

Creating Icons for the Desktop

Desktop icons are associated with:

  • Action files and data types in File Manager and Application Manager

  • Front Panel controls

  • Minimized application windows

  • Graphics used by applications such as palettes and toolbars

  • Workspace backdrop


Note - The development environment documentation contains additional information about desktop icons. See Chapter 4, "Visual Design," in theCommon Desktop Environment: Style Guide and Certification Checklist.


Icon Image Files

For the desktop to use an icon image, the icon image file must:

  • Be in the proper format.

  • Use the proper file-naming conventions.

  • Use the desktop size conventions.

  • Be located in a directory along the icon search path.

  • Be called by the desktop construct using the proper syntax. For example, if you create a new control for the Front Panel, use the ICON field in the Front Panel definition to specify the icon image to use for the control.

Icon File Formats

For a color display, use X pixmap (XPM) format icon files, which typically have a.pm suffix. Otherwise, use X bitmap (XBM) format files, which typically have a .bm suffix. If transparency is used in the pixmap file, a mask file (_m.bm) is generated when the .bm file is created. See "Icon Search Path" for more information about how the desktop finds these files.

Icon File Names

Each icon and backdrop image is stored as a separate file. Typically, an icon is specified with the base part of its file name. For example, an icon might be referenced with the name mail when the file is actually stored as:

/usr/dt/appconfig/icons/language/mail.l.pm

The file-naming convention of adding suffixes helps group icons by size and type. Icon names for desktop components are in these general formats:

basename.size.format

Or

basename.format

where:

basename--the image base name used to reference the image

size--a letter indicating the size: l (large) m (medium) s (small) t (tiny)

format--file format: pm (pixmap) bm (bitmap)

Icon Size Conventions

Table 14-1shows the recommended pixel dimensions for desktop icons.

Table 14-1 Icon Sizes and File Names

Icon Size

Bitmap Name

Pixmap Name

16 by 16 (tiny)

name.t.bm

name.t.pm

24 by 24 (small)

name.s.bm

name.s.pm

32 by 32 (medium)

name.m.bm

name.m.pm

48 by 48 (large)

name.l.bm

name.l.pm

Table 14-2 shows the icon sizes used by the desktop components. In some cases, the size of the icon used depends on the display resolution.

Table 14-2 Desktop Components and Their Icon Sizes

Desktop Component

High Resolution

Medium Resolution

Low Resolution

File Manager and Application Manager (View by Name and Icon)

medium

medium

medium

File Manager and Application Manager (View by Name and Small Icon)

tiny

tiny

tiny

Main Front Panel controls

large

large

medium

Front Panel subpanels

medium

medium

tiny

Front Panel switch controls

small

small

tiny

Minimized windows

large

large

medium

For example, if you specify an icon named mail for a data type, have a color display, and have set the File Manager preferences to small icons, the icon image used is mail.t.pm.

Icon Search Path

The desktop finds an icon file, or image, by searching for the file in a list of directories. This list of directories, called the icon search path, is determined by the value of several environment variables. Which variables are used and how they are put together to create the icon search path are discussed in "Icon Search Path".

The default search path is:

  • Built-in icons: /usr/dt/appconfig/icons/language

  • System-wide icons: /etc/dt/appconfig/icons/language

  • Personal icons: HomeDirectory/.dt/icons

 
 
 
  Previous   Contents   Next