Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ buildmenu(1) — SunCD Demo 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xnews(1)

sunview(1)

BUILDMENU(1)  —  USER COMMANDS

NAME

buildmenu − builds an OpenWindows (tNt) Menu from a SunView style menu file. 

SYNOPSIS

buildmenu [ −root ] [ −title title ] [ −position position ] [ −pinnable ] [ menufile ]
 

DESCRIPTION

buildmenu converts a SunView menu file into the NeWS toolkit PostScript commands to build the same menu under OpenWindows. 

If the filename is missing, the menufile is read from ~/.openwin-menu.  If the filename is ’-’, the menufile is read from stdin.  In any case, the PostScript language is written to stdout. 

The expected usage would be for the user to insert a submenu into the default root menu rather than simply copying the default root menu and modifying it. 

For example if you have a SunView style menu in ~/.mymenu you would put this line in your .openwin-init to append your menu to the default OpenWindows root menu. 

buildmenu ~/.mymenu -position 99 -title “My Tools” -pinnable | psh
 

The OpenWindows Menu File Format

The file $OPENWINHOME/lib/openwin-menu contains the specification of the default OpenWindows menu.  You can change the OpenWindows menu by creating your own file and storing it in your home directory with the name .openwin-menu. 

Lines in the file have the following format:  The left side is a menu item to be displayed, and the right side is a command to be executed when that menu item is chosen.  Lines may be continued to the next line by putting a backslash at the end of the line to be continued.  Blank lines and comment lines beginning with ’#’ are ignored. 

The menu items can be any string as long as strings with embedded blanks are delimited by double quotes.  The SunView notion of having the full pathname of an icon file delimited by angle brackets is unsupported and the basename(1) of the icon file is used as the item label in place of the icon. 

There are five reserved-word commands that can appear on the right side. 

EXIT Exit OpenWindows (requires confirmation). 

REFRESH Redraw the entire screen. 

MENU This menu item is a pull-right item with a submenu.  If a filename follows the MENU command, the submenu contents are taken from that file, (shell varaiables and ~’s are interpreted correctly).  Otherwise, all the lines between a MENU command and a matching END command are added to the submenu. 

END Mark the end of a nested submenu.  The left side of this line should match the left side of a line with a MENU command.  If the string PIN follows the END command then this submenu has an OpenLook pin on it. 

POSTSCRIPT This rest of the line is to be directly interpreted as PostScript language code when the item is invoked. 

If the command is not one of these five reserved-word commands, it is treated as a command line and executed.  Full shell interpretation is done on the commands. 

Here is a menu file that demonstrates all of these features

"Mail reader"mailtool

"My tools"MENU~/.rootmenu

"Click to type"POSTSCRIPT/ClickFocus setfocusmode

"Follow mouse"POSTSCRIPT/CursorFocus setfocusmode

"Print selection"news_selection | lpr

"Nested menu"MENU

"Command Tool"cmdtool

"Shell Tool"shelltool

"Nested menu"ENDPIN

RepaintREFRESH

QuitEXIT
 
 

OPTIONS

−root
This replaces the existing rootmenu rather than inserting or changing an item in it.  OpenWindows uses this mode to install your default menu from ~/.openwin-menu or $OPENWINHOME/lib/openwin-menu if ~/.openwin-menu does not exist.

−title title
This sets the name of the menu item you wish to insert.  If there already exists an item in the root menu with the label "title" then this menu item is replaced by this menu.  If you have also set -root above then this sets the title of the root menu. 

−position position
This sets where you would like this item to be inserted in the root menu. This option has no effect if you specify -root, since you are replacing the whole root menu.  The default is 0, meaning insert at the beginning of the root menu. 

−pinnable
This makes the top level menu you are inserting have an OpenLook pin.  The default is to not have one.
 

FILES

 
$OPENWINHOME/lib/openwin-menu
 

SEE ALSO

  xnews(1), sunview(1)

X11/NeWS 1.0  —  Last change: 10 Jul 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026