[Newbies] Handling events on NCAAConnectorMorph subclass
Nicola Mingotti
nmingotti at gmail.com
Sat Jul 13 17:03:13 UTC 2019
Hi,
I am using package Connectors.
I made my own connectors subclassing NCAAConnectorMorph [say it is
called MyCon]
Now, I would like the aMyCon to change its color to black when it is
connected to other 2 morphs and be orange when it is not fully connected.
I saw there is NCAAEventsHandler with stateConnected and
stateDisconnected but I don't understand how i can use these two events.
I tried defining inside the class MyCon methods like these, copying what
I do for mouse events:
------------
handlesStateConnected: evt
^ true
stateConnected: evt
self color: Color black
------------
It does not work.
How should I do ? I don't find an example.
Are NCAAEventsHandler events recognized by NCAAConnectorMorph ?
I would like my event handler to add up to what the default event
handler does, not substituting it.
bye
Nicola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190713/1135b2a7/attachment.html>
More information about the Beginners
mailing list