Previous Next Chapter

ICONS.OPEN

This will open the currently selected icons. Workbench may bring up a requester in case project icons are found which lack a default tool.

ICONS.COPY

This will duplicate the currently selected icons.

ICONS.RENAME

This will prompt the user to choose a new name for each currently selected icon.

ICONS.INFORMATION

This will open the information window for every currently selected icon.

ICONS.SNAPSHOT

This will lock the position of every currently selected icon.

ICONS.UNSNAPSHOT

This will unlock the position of every currently selected icon.

ICONS.LEAVEOUT

This will permanently put all currently selected icons on the Workbench root window.

ICONS.PUTAWAY

This will move all currently selected icons out of the root window and put them back into the drawers they belong.

ICONS.DELETE

This will cause all currently selected files to be deleted, provided the user confirms this action first.

ICONS.FORMATDISK

This will invoke the Format" command on every currently selected disk icon. This will not format the disks immediately. The user will have to confirm this action first.

ICONS.EMPTYTRASH

With a trashcan icon selected, this will empty it.

TOOLS.RESETWB

This will close and reopen all Workbench windows.

The HELP command will provide a complete list of menu items that can be invoked. Depending on the state of each menu item (e.g. the Open" menu item will be disabled if no icon is currently selected) the MENU command can silently fail to invoke the item you had in mind.

Errors:

10 - If the named window cannot be found, none of the Workbench windows are currently active and the command was set to work on the currently active Workbench window. The command can also fail if you tried to add a duplicate of an existing menu item or if the menu item to remove does not exist. The error code will be placed in the WORKBENCH.LASTERROR variable.

Result:

-

Example:

/* Invoke the About" menu. */
ADDRESS workbench

MENU WINDOW root INVOKE WORKBENCH.ABOUT

/* Add an item to the Tools" menu; selecting it * will cause the ARexx script by the name test.wb" * to be executed. ARexx will search for that program * in the REXX:" directory. If no test.wb" file can * be found, ARexx will attempt to execute a script * by the name of test.rexx". */
MENU ADD NAME test1 TITLE ,"Execute a script", SHORTCUT ,!` CMD ,test`

/* Add an item to the Tools" menu; selecting it * will cause a short inline program to be executed. */
MENU ADD NAME test2 TITLE ,"Short inline program", CMD `say 42"

/* Add an item to the Tools" menu; selecting it * will cause the Workbench About" menu item to be invoked. */
MENU ADD NAME test3 TITLE ,"About...", CMD `MENU INVOKE WORKBENCH.ABOUT"

/* Remove the first menu item we added above. */
MENU REMOVE NAME test1

Top Previous Next Chapter