| Did you know ... | Search Documentation: |
| graphical->recogniser |
Recognisers associated this way are store very similar to attributes
associated with object->attribute.
If the graphical is saved to a file using object->save_in_file,
the recognisers will be saved with the graphical
object.
Using class-level programming, recognisers mat be associated with graphical
objects in two ways: by redefining the
graphical->initialise
method, calling graphical->recogniser
to associate event handling or by redefining the class graphical->event
method.
The following example defines movable_box as a class:
:- pce_begin_class(movable_box, box).
:- pce_global(@movable_box_recogniser,
new(move_gesture)).
event(MB, Ev:event) :->
"Associate @movable_box_recogniser"::
( send(MB, send_super, event, Ev)
; send(@movable_box_recogniser, event, Ev)
).
:- pce_end_class.
See also: class gesture,
class event, graphical->prepend_recongiser,
event->post, pce_global/2.