[Cuis-dev] Morph color
juan at jvuletich.org
Mon Nov 4 07:10:43 PST 2019
On 11/2/2019 4:00 PM, Ala'a Mohammad via Cuis-dev wrote:
> My name is Ala'a, and I live in UAE.
> I'm new to this mailing list and to Cuis Smalltalk. I'd been attracted
> to its simplification core value. I've been wading my way through the
> classes, their documentation, experimenting and re-learning Smalltalk
Welcome to the Cuis community. I hope you find Cuis useful and fun.
> I understood (correct me if i'm wrong) that Morphic framework is
> different from other Smalltalk dialects (i.e. Pharo and Squeak), and
> in the transition to version 3 which is better.
Yes. Morphic has gone through a redesign of the core classes, starting
with Morph. Also, all coordinates are now relative to a local coordinate
system. In the future, when VectorGraphics.pck is the default graphics
engine, it will also be zoomeable, and independent of display
resolution. I called this Morphic 3.
> Thus I began reading
> its related classes one of them was Morph and while experimenting I've
> found strange thing about its initial color. Every instance is Blue in
> color and I can not use color: selector to change it, the debugger
> shows up since Morph instance did not understand the message.
> upon Browsing the class there was no color: method and only a read
> color which was a constant ^Color blue.
> Is this intentional? and if so what is the motivation?
Yes, it is intentional. Morph is the most general superclass of all
Morphs. Imagine you want to write a RainbowMorph. What would its color
be? Does it make sense to be able to change it at all?
Having a single color is quite an arbitrary decision many morphs may not
make. Giving the option to change the color even more so. Some specific
subclasses do chose to allow this. That's the idea.
In Squeak, Morph assumes it is a rectangular shape with a color and a
border. I don't think this is general enough for the root of the hierarchy.
> Thanks again for this great software.
More information about the Cuis-dev