Fernando,
> Do you know of Self environment for Windows? I've only seen it for
> solaris (which I don't have)...
>
> PS No, I'm not a traitor };-),
That's what they all say :)
> I jsut want to study the GUI as I'm
> playing with St app that might benefit of some of Self's features (see
>
http://tinyurl.com/hydxl)
Based on a brief scan of that thread, I would prefer to see you use
delegation instead of stretching inheritance. Suppose you have a
TextStyle with #fontName and #pointSize. You could add #baseStyle, and
delegate all nil aspects to it, which would look something like
pointSize
^pointSize notNil
ifTrue:[ pointSize ]
ifFalse:[ baseStyle pointSize ].
Then
bigTextStyle := TextStyle new
baseStyle:TextStyle default;
pointSize:TextStyle default pointSize * 2;
yourself.
gives something with twice the default point size (now cached, but you
can make it dynamic with blocks if needed).
As anticipated above, DefaultStyle should probably not be a class:
TextStyle default
should answer a useful instance; ditto for the other style classes. You
can initialize the defaults either lazily or in a class side #initialize
method [*]. This will give you a great opportunity (if you have not
done so already) to understand class instance variables. You will
probably end up with an abstract style class (where the baseStyle iv
will live), with the other styles derived from it. The default style
should be a class instance variable; try it as a class variable and it
will become clear as soon as you try to create and cache a default
instance for say ParagraphStyle.
[*] on the class size, never super-send #initialize; simply initialize
your class and class instance variables for the receiving class and let
the other classes do the same as they are loaded or explicitly initialized.
Re Self, Squeak's Morphic framework has roots in Self, and is (to a
point at least) worth a look.
If you have never used Squeak/Morphic before, start here:
http://static.squeak.org/tutorials/morphic-tutorial-1.htmlFor more on Morphic and Self, scroll down a little here:
http://www.squeak.org/Features/MultiMedia/Have a good one,
Bill
--
Wilhelm K. Schwab, Ph.D.
[hidden email]