|
|
The action of pressing a mouse button while pointing to an icon is called an icon trigger, because it triggers an action associated with the icon. ``Icon triggers'' shows the default icon triggers.
Icon triggers
User | Mouse | Trigger | Object script | Used for |
---|---|---|---|---|
action | button | type | file name | |
double-click | 1 | static | activate | start |
double-click | 2 | static | alt_activate | alternate start |
hold down | 3 | hold | menu | pop-up menu |
drag and drop | 1 | drop | drop | start on file |
drag and drop | 2 | drop | drop | start on file |
drag and drop | <Ctrl> 1 | drop | alt_drop | alternate start on file |
drag and drop | <Ctrl> | 2 | drop | alt_drop |
alternate start on file |
You should only define actions for the triggers listed in ``Icon triggers''. Other user manipulations of your icon (single-clicking on it or dragging it to a new location, for example) are handled automatically. Sample object scripts for activate, drop, and menu triggers are presented on the following pages.
The activate trigger must be used to start your application. By default, double-clicking with mouse button 2 (the alt_activate trigger) brings up a a dialog box that prompts the user for command line options to the startup command in your activate script. Similarly, a file icon dragged with mouse button 3 and dropped on your icon (the d3 trigger) brings up a prompt for startup options, then executes your script for the drop trigger.
Use the Deskshell command language to write object scripts. It provides the same basic functions as the Bourne shell, along with additional commands for defining special Desktop actions. Instructions for using Deskshell are in the chapter ``Writing scripts in Deskshell'' in the Graphical Environment Guide.
Only write object scripts for those triggers that are relevant to your application. For example, an application that simply displays a clock does not need to define what happens when a text file is dropped on it. If a trigger is not defined with an object script, a message will notify the user that the action (double-click, hold, or drop) is not defined for that button.
You can use a similar application's trigger files as templates for
yours, by copying them to the desired filenames.
In doing so, you will include default rules for 2-state animation.