| United States-English |
|
|
|
![]() |
Common Desktop Environment: Advanced User's and System Administrator's Guide > Chapter 10 Creating
Actions ManuallyRestricting Actions to Certain Arguments |
|
Restricting an action to a particular type of argument refines the action. For example, it is useful to restrict an action that invokes a viewer for PostScript files to only PostScript file arguments; with the restriction, the action will return an error dialog if a non-PostScript file is specified. You can restrict actions based on:
Use the ARG_TYPE field to specify the data types for which the action is valid. Use the data attribute name. You can enter a list of data types; separate the entries with commas. For example, the following action definition assumes a Gif data type has been created.
Use the ARG_COUNT field to specify the number of arguments the action can accept. Valid values are:
One use for ARG_COUNT is to provide different action icon behavior, depending on whether the user double-clicks the icon or drops a file on it. See the next section, “To Provide Different Double-Click and Drop Behavior”. Use this procedure to create an action that accepts a dropped file but does not prompt for a file when the action icon is double-clicked.
For example, suppose the following two command lines can be used to start an editor named vedit:
The following two actions create drop and double-click functionality for an action named Vedit. The first action has precedence when the database is searched for a match, since ARG_COUNT 0 is more specific than the implied ARG_COUNT * of the drop functionality definition.
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||