| Did you know ... | Search Documentation: |
| node->event |
->event
is a little different from the other refinements of graphical->event
as class node is not a
subclass of graphical. It is invoked from tree->event
and allows for adding behaviour to nodes regardless of the underlying
graphicals.
The default method uses central handler
objects from the associated node<-tree:
a) If it is collapsed, run <-collapsed_handlers b) If it is a leaf, run <-leaf_handlers c) If it is the display_root, run <-root_handlers d) else, run <-node_handlers
In each of the cases a) to d), run means invoke the
following message for each of the members of the handler-chain:
`event ->post: graphical, recogniser`
If you wish to refine this method, please be aware that the normal
schema described with graphical->event
does not work for nodes. Here is a skeleton implementation:
:- pce_global(@my_node_recogniser,
make_my_node_recogniser).
make_my_node_recogniser(G) :-
...
event(Node, Ev:event) :->
( send_super(Node, event, Ev)
-> true
; send(Ev, post, Node?image,
@my_node_recogniser)
).