Cuis-Smalltalk / TheCuisBook

A book about Cuis Smalltalk
64 stars 9 forks source link

Daily Workflow : windows not deleted #25

Closed gamecubate closed 1 year ago

gamecubate commented 1 year ago

Launching Squeak+Cuis (latest image) from the command line (macOS 13.0.1) thus:

[Cuis-Smalltalk-Dev (master)]$ ../Squeak.app/Contents/MacOS/Squeak Cuis6.0-5686.image -s ../setUpEnvironment.st 

2023-03-18 14:52:06.130 Squeak[16153:9160579] Warning: Expected min height of view: (<NSButton: 0x7f9116114120>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.

where setUpEnvironment.st contents are:

| list morph |

"Delete all windows but the taskbar"
list := UISupervisor ui submorphs reject: [:aMorph | aMorph is: #TaskbarMorph].
list do: [:each | each delete].

"Change to Dark theme"
Feature require: #'Theme-Themes'.
DarkTheme beCurrent.
"Adjust font size"
Preferences smallFonts.
"Adjust taskbar size"
morph := UISupervisor ui submorphs first.
morph scale: 1 / 2.
Display fullScreenMode: true.

self runningWorld doOneCycle.

results in a successful changing of the theme but an unsuccessful deletion of the default About Cuis and Transcript windows.

gamecubate commented 1 year ago

I suspect that the script is run prior to the WorldMorph >> recreateDefaultDesktop message is sent.

gamecubate commented 1 year ago

Fixed by invoking self runningWorld doOneCycle. before the window deletion block.

| list morph |

self runningWorld doOneCycle.

"Delete all windows but the taskbar"
list := UISupervisor ui submorphs reject: [:aMorph | aMorph is: #TaskbarMorph].
list do: [:each | each delete].

"Change to Dark theme"
Feature require: #'Theme-Themes'.
DarkTheme beCurrent.
"Adjust font size"
Preferences at: #guiElementsSize put: #smallFonts.
"Adjust taskbar size"
morph := UISupervisor ui taskbar.
morph scale: 1 / 2.
Display fullScreenMode: true.
gamecubate commented 1 year ago

Closing (non) issue