DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Integrating applications into the Desktop

Starting your application with the drop trigger

If your application uses text, graphic, or other data files, users expect that dropping a file icon on your icon will start your application working on that file. For example, dropping a text file on an editor's icon should start the editor with the text file open and ready to edit.

The following drop object script starts a text editor and passes to the editor the name of the file dropped on it. The system sets the variable $dynamic_args to the filename(s) represented by the dropped icon(s). (For more about Desktop variables, see the Graphical Environment Guide.)

   begin
   shell -t 'Editor' vi $dynamic_args
   finish
The begin and finish statements cause the displayed icon to change from closed to activated, if you created the appropriate pixmap files.

Users can drop a group of icons on your application's icon. Consider how your application will handle this. For example, should the text editor open an editor window for each icon dropped? Or should it open one file and place the others in a queue? If more than one approach could be useful, let users choose the default behavior.


Next topic: Popping up a menu with the menu trigger
Previous topic: Starting your application with the activate trigger

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003