[squeak-dev] Closing a SystemWindow when all you have is a Model
Frank Shearar
frank.shearar at angband.za.org
Tue Mar 15 23:10:52 UTC 2011
I wrote a test for CodeHolder>>spawnHierarchy. It's neat, it works...
and it opens up a HierarchyBrowser. I have a reference to the
HierarchyBrowser but not the SystemWindow that contains it.
What I'm trying to find is what to put here:
spawn := browser spawnHierarchy.
["run my tests"]
ensure: ["what goes here to close the SystemWindow?"]
I had thought of this:
PluggableSystemWindow allInstances
detect: [ :each | each model == spawn ]
ifFound: [ :each | each delete ]
ifNone: []]
which works if you make CodeHolder>>spawnHierarchy return the new
HierarchyBrowser.
Is this a simply dreadful idea? Is there a less hacky way than this?
Would this work outside Morphic?
frank
More information about the Squeak-dev
mailing list
|