[squeak-dev] Morphic question. I need to toggle the close buttons on a bunch of workspaces that are uncloseable....

Marcel Taeumel marcel.taeumel at hpi.de
Mon Nov 29 15:26:19 UTC 2021


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 at 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,
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211129/a8087752/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 84028 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211129/a8087752/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 34477 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211129/a8087752/attachment-0003.png>


More information about the Squeak-dev mailing list