Next Previous Up Top Contents Index

9.4 DUIM-Frames Module

add-command

Generic function

Summary

Adds a command to the specified command table.

Signature

add-command command-table command #key name menu image accelerator mnemonic error? => ()

Arguments

command-table
An instance of type <command-table>.

command
An instance of type type-union(<command>, <function>).

name
An instance of type false-or(<string>).

menu
An instance of type false-or(<menu>).

image
An instance of type false-or(<image>).

accelerator
An instance of type false-or(<gesture>).

mnemonic
An instance of type false-or(<gesture>).

error?
An instance of type <boolean>. Default value: #t.

Values

None

Library

duim-frames

Module

duim-frames

Description

You can supply a keyboard accelerator or a mnemonic using the accelerator and mnemonic arguments respectively.

Adds command to command-table.

The argument name is the command-line name for the command.

For the purposes of command-line name lookup, the character case of name is ignored.

The argument menu is a menu for command.

You can supply an image that will appear on the menu next to the command name using the image argument. When supplying an image, bear in mind the size of the menu: you should only supply a small icon-sized image for a menu command. There may also be other interface guidelines that you wish to follow when using images in menu items.

The value for accelerator is either keyboard gesture or #f. When it is a gesture, this gesture represents the keystroke accelerator for the command; otherwise the command is not available via keystroke accelerators. Similarly, if mnemonic is supplied, this gesture is used as a mnemonic for the command.

If command is already present in the command table and error? is #t, an error is signalled. When command is already present in the command table and error? is #f}, then the old command-line name, menu, and keystroke accelerator are removed from the command table before creating the new one.

See also

remove-command, page 843


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index