Using SystemWindow
Ned Konz
ned at bike-nomad.com
Wed Nov 13 22:06:06 UTC 2002
On Wednesday 13 November 2002 01:52 pm, David Duke wrote:
> I'm having a problem with the SystemWindow class. After working
> back from and simplifying the code that gave me the original
> problem, it seems that the situation can be illustrated thus:
>
> (a) if I create and open a morph -- for example, the simple
> "TestMorph" from the "blue" Squeak book, pg 44, it behaves as I
> expect (that is, as described in the book).
>
> (b) if I try to embed this morph in a SystemWindow, e.g. issue the
> following commands from a workspace,
>
> t _ TestMorph new.
> s _ (SystemWindow labelled: 'test') openInWorld.
> s addMorph: t frame: ((0 at 0) corner: (0.5 at 0.5)).
>
> then all I get is a black oval!
>
> (c) If I add a RectangleMorph to a SystemWindow, the rendered morph
> correctly changes colour when I send the "color:" message.
> However, if the morph is an EllipseMorph, it appears black, and
> remains black.
Try this:
t _ EllipseMorph new.
s _ (SystemWindow labelled: 'test') openInWorld.
s addMorph: t frame: ((0 at 0) corner: (0.5 at 0.5)).
t borderColor: Color red
t color: Color yellow
You're getting the right behavior. Try turning off the "alternative
window look" Preference. I think what's happening is that when Morphs
are added to SystemWindows they get their color set by the window
code.
Note that #color sets the interior color of an EllipseMorph (and for
that matter a RectangleMorph). #borderColor sets the border's color.
Though I don't know about your problem with the EllipseMorph not
responding to #color. What's your display depth?
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|