[Newbies] Handling events on NCAAConnectorMorph subclass
Nicola Mingotti
nmingotti at gmail.com
Sun Jul 14 14:58:26 UTC 2019
Never mind, I guess i found the methods I was looking for:
enterConnected
exitDraggingEnd
bye
Nicola
On 7/13/19 7:03 PM, Nicola Mingotti wrote:
> 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/20190714/f356cdaf/attachment.html>
More information about the Beginners
mailing list