[squeak-dev] Re: Closing a SystemWindow when all you have is a Model

Andreas Raab andreas.raab at gmx.de
Tue Mar 15 23:24:33 UTC 2011


On 3/15/2011 16:10, Frank Shearar wrote:
> 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?

Try "ToolBuilder default close: spawn topView".

Cheers,
   - Andreas



More information about the Squeak-dev mailing list