Confusion with instances and events

Cowdery, Bob [UK] Bob.Cowdery at CGI-Europe.com
Mon May 1 20:54:42 UTC 2006


 

On 5/1/06, Cowdery, Bob [UK] <Bob.Cowdery at cgi-europe.com> wrote: 

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. 

 Ralph Johnson wrote: 

There isn't enough information for me to figure out your main problem,
but I think I know this one.

 

I bet that newWithInteractors: does not actually create an instance of
SDRButtonContainer.  You say it "ismply has a class initialise" so I
think you are just storing the arguments in a variable of the class, but
do not actually create an instance of the class.  Note that
SDRButtonContainer is a class, it is not itself a SDRButtonContainer.
So, it has not instances and allInstances SHOULD return nothing. 

 

In general, we will need more info to debug this.  Give more code.

 

It is being created Ralph, but see below.

 

Tom Phonex wrote:

This sounds as if your object was garbage collected. If you want to keep
your object, store it somewhere. Objects that aren't stored anywhere get
cleaned up.

 

Well, it's the obvious reason, but I couldn't see why the behavior was
different. Now I can. Some components set maps that create an indirect
reference to the parent, others don't. The ones that don't do get
garbage collected which up to now hasn't mattered because all calls in
these components are to the morph not the parent. I think I will stop
doing this stuff in the workspace and write a script to properly create
and clean up the instances.

 

Thanks both for your 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/e7e5cdf5/attachment.htm


More information about the Squeak-dev mailing list