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

Frank Shearar frank.shearar at angband.za.org
Wed Mar 16 09:31:05 UTC 2011


On 2011/03/15 23:24, Andreas Raab wrote:
> 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".

Ah! That's much neater than my hack. Thanks!

frank




More information about the Squeak-dev mailing list