Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!tub!db0tui11!MUHRTH From: MUHRTH@DB0TUI11.BITNET (Thomas Muhr) Newsgroups: comp.lang.smalltalk Subject: 2 views on same model - a solution Message-ID: <471@DB0TUI11.BITNET> Date: 15 Dec 89 12:21:54 GMT Reply-To: MUHRTH@DB0TUI11.BITNET (Thomas Muhr) Organization: TU Berlin Lines: 38 Disclaimer: Author bears full responsibility for contents of this article I desperately hope that this is the solution to a problem I stated 2 days ago: How could one have two views on the same model in overlapping windows and close one view without destroying ALL dependents between the model and all views. If it wasn_t for Brian LeClaire (thanks a lot) I would have shed a lot of tears about it. Brian proposed an inverted release-method to accompany the release method in Object: Not removing the model-entry from the dependents list, which is a very, very crude approach, but remove the pane from the dependency-list of the model, which is very subtle and seems to work: With some minor modifications here is Brian's 'release': !Object methods ! release: aPane " Autor: Th. Muhr Datum: Dec 15, 1989 Modifiziert von Th. Muhr : Dec 15, 1989 Kommentar: Modifikation nach Brian LeClaire " |coll| coll:= Dependents at:self ifAbsent:[^self]. coll remove: aPane ifAbsent:[]. coll isEmpty ifTrue: [Dependents removeKey:self]! ! All (Pane)'calls' to release (only one) have to be modified to: release (in TopPane) model release:self. model:= nil. This seems to work. Good images to everyone and a happy new year- Thomas ------- Thomas Muhr, Technical University of Berlin, BITNET: muhrth@db0tui11 Project ATLAS - Computer Based Tools for Qualitative Research "Computers, like every technology, are a vehicle for the transformation of tradition." (WINOGRAD/FLORES)