define-operation ( pred command flags -- )
Factor handbook » UI framework » Implementing new gadgets » UI gestures » Operations

Prev:operation
Next:primary-operation ( obj -- operation )


Vocabulary
ui.operations

Inputs
preda quotation with stack effect ( obj -- ? )
commanda word
flagsa hashtable


Outputs
None

Word description
Defines an operation on objects matching the predicate. The hashtable can contain the following keys:
+listener+ - if set to a true value, the operation will run in the listener
+description+ - can be set to a string description of the operation
+primary+ - if set to a true value, the operation will be output by primary-operation when applied to an object satisfying the predicate
+secondary+ - if set to a true value, the operation will be output by secondary-operation when applied to an object satisfying the predicate
+keyboard+ - can be set to a keyboard gesture; the gesture will be used by define-operation-map


Definition