Search code examples
smalltalkpharo

How to close all inspector windows with a shortcut


Is there a shortcut to close all inspector windows ? and if not how I close the window of a selected inspector ?

Basically I accidentally opened over 1000 inspector windows and i want to close them all now because they have occupied the entire GUI and I cant do anything other than closing them on by one. I cant open the world menu or open a new window because they take not only the entire window but also they are always on top.


Solution

  • Bring up the halos [1] on the TaskBarMorph [2] and click the top left halo to delete it from the World.

    1. If two-way halo cycling is enabled in the settings, Alt-click on Mac. Otherwise, Alt-Shift-Click to cycle to the TaskBarMorph through the morphs in front of it.
    2. In your case, your problem is that it's covering the entire screen, so you should be able to click anywhere to bring up the halos.

    Then, to actually close the windows, use something like:

    World submorphs do: [ :e |  
        [ (e model model model isKindOf: InspectorNavigator) ifTrue: [ e delete ] ] 
            on: Error 
            do: [ ] ]