[squeak-dev] Abusing #userInterfaceTheme

H. Hirzel hannes.hirzel at gmail.com
Fri Sep 22 10:39:21 UTC 2017


Stéphane

Could you please summarize in one mail which changes to the
UserInterface theme mechanism you propose and why you think that
should be done?

--HH.

On 9/19/17, Stéphane Rollandin <lecteur at zogotounga.net> wrote:
>> You do not know in advance how the object stored in a theme will be used
>> by the client. It is not always a simple instVar write.
>>
>> Consider this example:
>>
>> slider borderColor: ((self userInterfaceTheme borderColorModifier
>> ifNil: [ [:c | c adjustBrightness: -0.3] ]) value: aColor).
>
>
> This can easily be folded back into the getter/setter pattern:
>
> 	BorderedMorph>>borderColorModifier: aBlock
> 	    self borderColor: (aBlock value: self borderColor)
>
> and then
>
> 	self borderColor: aColor.
> 	self getThemed: #borderColorModifier
> 		ifNone: [:c | c adjustBrightness: -0.3]
>
>
> So I guess it's down to a design choice. I would vote for consistency of
> pattern, and having everything written in getter/setter pairs.
>
>
> Best,
>
>
> Stef
>
>


More information about the Squeak-dev mailing list