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

Popping up a menu with the menu trigger

Only button 3 can be used as a popup menu trigger. If defined, the menu trigger must display a pop-up menu.

For example, this menu script pops up the menu PopupClockMenu (which is used to start xclock with different startup options):

  1 rule='
  2 menu: PopupClockMenu
  3 {
  4   menu_item
  5   {
  6     title='digital'
  7     action
  8     {
  9 	begin
 10 	xclock -digital
 11 	finish
 12     }
 13   }
 14   menu_item
 15   {
 16     title='analog'
 17     action
 18     {
 19 	begin
 20 	xclock
 21 	finish
 22     }
 23   }
 24   dividing_line;
 25   menu_item
 26   {
 27     title='help'
 28     action
 29     {
 30 	help 'static_arg'
 31     }
 32   }
 33 remove_dynamic_rule PopupClockMenu
 34 dynamic_rule PopupClockMenu $rule
 35 popup PopupClockMenu $static_arg

lines 4-23
Define the digital and analog menu items. Each item causes the xclock executable to be run with the appropriate option.

line 24
Creates a horizontal line between the first two menu items and the last.

lines 25-32
Defines the help menu item.

lines 33-35
Removes any old PopupClockMenu, creates a new dynamic PopupClockMenu, and creates the popup menu.

Next topic: Install icon files
Previous topic: Starting your application with the drop trigger

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