[squeak-dev] Abusing #userInterfaceTheme
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.
Am 22.09.2017 12:39:24 schrieb H. Hirzel <hannes.hirzel at gmail.com>:
Could you please summarize in one mail which changes to the
UserInterface theme mechanism you propose and why you think that
should be done?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev