Background:
I'm looking into
https://pharo.fogbugz.com/f/cases/19973/DarkTheme-tool-bar-icons
Take for example UITheme>>
windowMaximizeForm
"Answer the form to use for the maximize button of a window."
"self haltOnce."
^self forms at: #windowMaximize ifAbsent: [ "self haltOnce"
Form extent: 10@10 depth: Display depth]
If I uncomment the top haltOnce, and then right-click on an item in
the bottom toolbar,
a debug window shows up as expected.
After changing the theme, I would expect "forms" to be nil.
But uncommenting only the second haltOnce inside the block,
then changing "System > Settings > Appearance > User interface theme"
to white then back to dark,
and then right-click on an item in the bottom toolbar,
does *not* produce a debug window.
Now upon booting a freshly downloaded 60469 image...
Pharo3DarkTheme allInstances size "==> 1"
then after changing System > Settings > Appearance > User interface theme
to white then back to dark...
Pharo3DarkTheme allInstances size "==> 2"
Its almost like changing themes creating a new instance of Pharo3DarkTheme,
but it doesn't get installed in the right places. Preliminary check...
"Booted fresh 60469 image. Opened a playground."
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->8}"
"Opened System > Settings"
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->14}"
"1. Changed Appearance > User interface theme to white then back to dark"
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->6. 954809088->12}"
"2. Changed Appearance > User interface theme to white then back to dark"
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->6. 954809088->1. 721110784->12}"
"3. Changed Appearance > User interface theme to white then back to dark"
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->6. 954809088->1. 721110784->1. 127158784->12}"
"Closed settings window."
Smalltalk garbageCollect.
Pharo3DarkTheme allInstances collect: [:i | i identityHash -> i
pointersTo size].
"{748241152->6. 127158784->12}"
Pharo3DarkTheme allInstances first pointersTo inspect.
Pharo3DarkTheme(UITheme)>>createCloseBoxFor:
Pharo3DarkTheme(UIThemeWatery)>>createCollapseBoxFor:
Pharo3DarkTheme(UIThemeWatery)>>createExpandBoxFor:
Pharo3DarkTheme(UITheme)>>createCloseBoxFor:
Pharo3DarkTheme>>createMenuBoxFor:
For a moment I was confused, by seeing only five items,
but of course the sixth was from the block variable "i".
Question: What I really am confused about is, for example in...
UITheme>>createCloseBoxFor: aSystemWindow
"Answer a button for closing the window."
^(self
newCloseControlIn: aSystemWindow
for: aSystemWindow
action: [aSystemWindow closeBoxHit]
help: 'Close this window' translated)
extent: aSystemWindow boxExtent
I can't understand where in that method a pointer/reference could
remain held. ???
cheers -ben