[squeak-dev] whisker browser

Marcel Taeumel marcel.taeumel at hpi.de
Mon May 25 07:19:14 UTC 2020


Hi Martin.

> The check (aFont isNil) seems to imply that nil is a valid value here. But if
you try, the method fails at [aFont emphasis].

Well, either aFont or emphasisCode can be nil. Not both. ;-) If I recall correctly, that's the existing usage I found when refactoring StringMorph last year in summer. It would be strange to support both arguments to be nil.

Background: Actually, the emphasis is part of the font object. However, it is possible to just store the emphasis in StringMorph and then fall back to the default font when needed -- with that emphasis. So, it is a bit of a mess, when you think about it. The user's model might separate font emphasis and font face. But the low-level implementation does not. Only StringMorph does.

Best,
Marcel
Am 24.05.2020 15:26:35 schrieb Martin Kuball <martinkuball at web.de>:
Hi!

I haven't used squeak for programing in years (yes, I know it's sad). Now that
I do, I noticed that there is no whisker package for 5.3. Well actually there
seems to be no package at all any more. So my question is, does anybody has a
whisker version that plays well with the current squeak version?

Meanwhile I loaded the version I used in 3.9. Had to fix some deprecated
warnings and some errors during initialization. I have it running now. But
it's missing some of the new features - like the icons - of the system
browser.

While fixing the errors I noticed the following method:

StringMorph>>font: aFont emphasis: emphasisCode

self
setFont: ((aFont isNil or: [aFont emphasis = emphasisCode] or:
[emphasisCode isNil])
ifTrue: [aFont]
ifFalse: [aFont emphasized: emphasisCode])
emphasis: (emphasisCode ifNil: [aFont emphasis]).

The check (aFont isNil) seems to imply that nil is a valid value here. But if
you try, the method fails at [aFont emphasis].

Martin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200525/ea251bb7/attachment.html>


More information about the Squeak-dev mailing list