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

How Actions Create Icons for Applications

Consider the Xwd Display icon in the Desktop_Tools application group. Double-clicking this icon runs the X client xwud. However, this icon does not directly represent the actual xwud executable /usr/bin/X11/xwud.

The icon labeled Xwd Display appears in the application group because there is a file in that directory named Xwud (see Figure 10–3). This file represents an underlying action with the same name—Xwud. In the action definition, the action name is the name following the ACTION keyword:

ACTION Xwud
 {
 LABEL               Xwd Display
 TYPE                COMMAND
 WINDOW_TYPE         NO_STDIO
 EXEC_STRING         /usr/bin/X11/xwud -noclick -in \
                     %(File)Arg_1"Xwd File To Display:"%
 DESCRIPTION         The Xwd Display (Xwud) XwdDisplay action \
                     displays an xwd file that was created using the \
                     Xwd Capture (Xwd) action. It uses \
                     the xwud command.
 }

The file is called an action file because it represents an action. A file is an action file when it is an executable file with the same name as an action. Its icon in Application Manager (or File Manager) is called an action icon, or application icon, because double-clicking it starts an application.

Figure 10–3 Application (action) icon representing an action file

Graphic

When Application Manager detects an executable file, it looks through the actions database to see if there are any actions whose names match the file name. If a match is found, Application Manager knows that the file is an action file.

The content of the action file is irrelevant; action files usually contain comments describing their desktop function.


Note –

The action file is not the same as the action definition file. The action file is a file with the same name as the action. It is used to create the application icon in File Manager or Application Manager. The action definition file is the file named name.dt containing the definition of the action.


Once the desktop determines that a file is an action file, the underlying action definition is used to define the appearance and behavior of the action file.

Figure 10–4 Icon image specified by the ICON field in the action definition

Graphic

The Xwud action is called a command action because its definition contains the command (EXEC_STRING) to be run. The TYPE field in the action definition defines the action type.

Initially, the Xwd Display icon appears in the Desktop_Tools application group. However, you can create additional copies of the action icon in any directory for which you have write permission. As long as the Xwud action definition is part of the database, any executable file you create named Xwud will be an action file representing that action, and its icon in File Manager or Application Manager can be used to run the action.