Hi Folks.
Somthing along the lines of this: World submorphs do: [ :e |
[ (e model isKindOf: Inspector) ifTrue: [ e delete ] ]
on: Error
do: [ ] ]
I have ~30 workspaces and 6 browsers minimized and the "close" button is not visible because I made them all uncloseable.
I would like to programmatically close them using something like the above.
cordially,
Hi,
Your code snippet sounds reasonable to me, for Inspectors of course. What exactly do you need to know further?
Guesses: The selector to make them programmatically closable is #makeClosable. With #mustNotClose you can test whether a window is currently unclosable. When you click on the close button (X) the window gets #closeBoxHit sent to it, but that eventually also sends #delete. You may want to check whether the morph is actually a SystemWindow, but other morphs would not often have a tool as their model. And finally, the classes of workspaces and browsers are Workspace and Browser, respectively -- easy enough.
Kind regards, Jakob
Am So., 28. Nov. 2021 um 19:28 Uhr schrieb gettimothy via Squeak-dev squeak-dev@lists.squeakfoundation.org:
Hi Folks.
Somthing along the lines of this:
World submorphs do: [ :e | [ (e model isKindOf: Inspector) ifTrue: [ e delete ] ] on: Error do: [ ] ]
I have ~30 workspaces and 6 browsers minimized and the "close" button is not visible because I made them all uncloseable.
I would like to programmatically close them using something like the above.
cordially,
Hi Timothy --
You can get inspiration from the "Windows" menu:
The debug halo on the selected menu item shows:
Which ends up in TheWorldMainDockingBar >> #closeAllWindows.
Best,
Marcel
Am 28.11.2021 19:38:04 schrieb Jakob Reschke jakres+squeak@gmail.com: Hi,
Your code snippet sounds reasonable to me, for Inspectors of course. What exactly do you need to know further?
Guesses: The selector to make them programmatically closable is #makeClosable. With #mustNotClose you can test whether a window is currently unclosable. When you click on the close button (X) the window gets #closeBoxHit sent to it, but that eventually also sends #delete. You may want to check whether the morph is actually a SystemWindow, but other morphs would not often have a tool as their model. And finally, the classes of workspaces and browsers are Workspace and Browser, respectively -- easy enough.
Kind regards, Jakob
Am So., 28. Nov. 2021 um 19:28 Uhr schrieb gettimothy via Squeak-dev :
Hi Folks.
Somthing along the lines of this:
World submorphs do: [ :e | [ (e model isKindOf: Inspector) ifTrue: [ e delete ] ] on: Error do: [ ] ]
I have ~30 workspaces and 6 browsers minimized and the "close" button is not visible because I made them all uncloseable.
I would like to programmatically close them using something like the above.
cordially,
squeak-dev@lists.squeakfoundation.org