[squeak-dev] Abusing #userInterfaceTheme

Marcel Taeumel marcel.taeumel at hpi.de
Fri Sep 22 12:31:26 UTC 2017


Looks like several changes to me. :)

Bert thinks that we should just create a helper object as a result of #userInterfaceTheme that captures the sending object and handles the DNU code. There would be no need for having "scope" anymore and client code can safely store the result of #userInterfaceTheme and pass around.

Best,
Marcel
Am 22.09.2017 12:39:24 schrieb H. Hirzel <hannes.hirzel at gmail.com>:
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 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170922/9189924e/attachment.html>


More information about the Squeak-dev mailing list