[squeak-dev] The Trunk: EToys-nice.323.mcz
Tobias Pape
Das.Linux at gmx.de
Fri Apr 6 21:51:03 UTC 2018
> On 06.04.2018, at 23:43, Tobias Pape <Das.Linux at gmx.de> wrote:
>
>
>> +
>> + "Fix SoundService default.
>> + One must not invoke this:
>> + SoundService default: SoundService defaultOrNil.
>> + because it fills the class inst var ''default'' with an instance instead of a class.
>> + This script checks if that ever happened and tries to restore a healthy default."
>> + (SoundService instVarNamed: #default)
>> + ifNotNil: [:ss | ss isBehavior ifFalse: [SoundService unregister: ss; default: ss class]].'!
>> - each instVarNamed: #turtlesToDisplay put: turtlesToDisplay asSet ] ] ]'!
>>
>>
> Hm, IIRC it was me who changed the class to an Instance. there was a reason, also…
>
> But it escaped my memory…
>
Ah, no, I also tried replacing the instances with classes
================================
Name: System-topa.715
Author: topa
Time: 2 April 2015, 10:57:12.703 am
UUID: 2a92cef0-6bb4-47b3-994e-994a626d54c8
Ancestors: System-ul.714
Make SoundService registeredClasses class-based.
Categorize in AppRegistry
================================
And here's the postscript of back then.
" Convert SoundService registeredClasses to classes if necessary "
[ | currentSoundSystem |
currentSoundSystem := SoundService defaultOrNil.
(SoundService registeredClasses copy collect: [:ss |
SoundService unregister: ss.
ss isBehavior
ifTrue: [ss]
ifFalse: [ss class]]
) do: [:ssClass |
SoundService register: ssClass].
SoundService default: (currentSoundSystem
ifNotNil: [:css| css isBehavior ifTrue: [css] ifFalse: [css class]]).
] value
More information about the Squeak-dev
mailing list
|