Confusion with instances and events

Cowdery, Bob [UK] Bob.Cowdery at CGI-Europe.com
Mon May 1 19:18:59 UTC 2006


Hi

 

I am getting myself pretty confused at the moment. Hopefully, someone
can unconfuse me. 

 

I have an application that essentially is a collection of specialised
morphs that are connected together to form the application. I am adding
some event mechanisms into this such that state changes are broadcast to
interested parties. The actual mechanism works fine on all my morphs
except one. Each morph is constructed exactly the same, there is a
control class which creates the morph and does 'openInWorld'. At present
I create all these components (for want of a better word) in a
workspace. As I had trouble with cleaning up stray references I do not
assign these components to a variable in the workspace when I create
them. What I have discovered is that the component that does not receive
the event DOES receive the event if, when I create it I do assign it to
a variable. To be clear the event is sent to the morph but the hook and
the target is set up by the owning component class.

 

The odd thing is that all the other components work without doing this
assignment. Another oddity that may shed more light is that if I do 'Pan
allInstances' I get an empty array even though I have done 'Pan new.'
(Pan being the class that does not work) in the workspace. If I do this
to another component 'OffsetDisp allInstances' I get the instances even
though it is created exactly the same way and has the same structure. To
prove this I created another OffsetDisp and got another instance. 

 

I have some other components which are created like so in the workspace
'SDRButtonContainer newWithInteractors: (SDRFilterButtonBox new).'. This
simply has a class initialise which takes a bunch of buttons. Odd thing
is the events work here but 'SDRButtonContainer allInstances' still
gives me nothing. I don't know therefore if these things are linked or
separate problems.

 

It's the inconsistency that is confusing. On the face of it I have three
components with very similar structure that all behave differently. 

 

Thanks for any help

 

Bob


*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060501/f54e4588/attachment.htm


More information about the Squeak-dev mailing list