define-operation-map ( class group blurb object translator -- ) (original) (raw)

define-operation-map ( class group blurb object translator -- )
Factor handbook » UI framework » Implementing new gadgets » UI gestures » Operations

Prev: secondary-operation ( obj -- operation )
Next: $operations ( element -- )

Vocabulary
ui.operations

Inputs

class a class word
group a string
blurb a string or f
object an object
translator a quotation with stack effect ( obj -- newobj ), or f

Outputs
None

Word description
Defines a command map named group on class consisting of operations applicable to object. The translator quotation is applied to the target gadget, and the result of the translator is passed to the operation.

Definition

USING: ui.commands ;

IN: ui.operations

: define-operation-map
( class group blurb object translator -- )
operations>commands define-command-map ;