Thanks Paolo,
Files are closed automatically.
Ok, but additionally, I was looking to write a summary-line at the end
of the files before they are closed.
However, you can use
ObjectMemory addDependent: self.
and then "self" will get a bunch of events dispatched via the #update:
method. grep "update:" in kernel/*.st for an example of its usage.
I tried it and found out (for me) that "ObjectMemory addDependent: self"
should be send in a class-method of "self". (in the case, that I did
that from an Object-method, nothing happens.) -> and so I found it in
the kernel/*.st files also.
Even #update: has to be a class method.
But how could I call from the class, a method from the instance?
You did that in FileWrapper like this:
aspect == #aboutToQuit ifTrue: [self broadcast: #release]
and the "Object" instance is the only place, where #broadcast: is
defined. (I was first looking for an implementation of #broadcast as a
class-method, but I only found the one in the Object-instance.)
But if I did it, I always get a MessageNotUnderstood Exception...
(Would it be an idea, to maintain an OrderedCollection in the class with
all the instances of this class, to iterate over all these in the case,
the #update: class-method is getting the #aboutToQuit?)
Regards,
Joachim.
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk