re:find object through TFarRef

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

re:find object through TFarRef

David Faught
Close but not quite.  Some comments below.

Rob Van Pamel wrote:

>I'm looking at the code from the Appendix 1 : P2P chat in tweak.
>Is it correct to assume the following ?
>anObject runscript: #message when:{aSender. #event}.
>if we then look at the example. we see
>self runScript:#servChatMessage:for:when:{aSpace. #chatMessage}.
>==> Is this what we call the eventhandler?
>self runScript takes care that the event can take place at any >time that aSpace calls the message(method) chatMessage?
>This code has to be entered at the place you want the code to be >executed right? Or doesn't this matthers?

The self runScript would typically be in the initialize code for the object that will receive the event to make it ready to receive.  #chatMessage is the event name in this example (see below), and #servChatMessage is the code(method) to be executed when the named event is received from aSpace.

>But i don't understand the meaning of servChatMessage? Is this >just for checking either the event has to be exeucted or not or >why do we call this method.
>aSender signal:#event.
>This have to entered at the place where the event is triggered. >Here #event is just the name of the method you want to be >executed.

Yes, in order to signal the example receiver above, this would need to be:

aSpace signal:#chatMessage.

>These are the 2 parts (and the event himself offcourse) that we >need to create a new event i suppose.