changing window and font colors

Michael Vanier squeak-dev at lists.squeakfoundation.org
Mon Oct 28 09:12:32 UTC 2002


Ned,

It turns out that after a little exploring I worked out this code snippet
that does most of what I need:

    Preferences setWindowColorFor: #Workspace 
                to: (Color r: 0.0 g: 0.3 b: 0.0).

    Preferences setWindowColorFor: #Browser 
                to: (Color r: 0.0 g: 0.3 b: 0.0).

    Preferences setParameter: #textColor to: (Color r: 0.8 g: 0.8 b: 0.8).
    "This is a non-standard font:"
    Preferences setSystemFontTo: (StrikeFont familyName: #Fixed size: 20).
    "You have to change the balloon color too or the text disappears:"
    BalloonMorph setBalloonColorTo: (Color r: 0.5 g: 0.4 b: 0.0).

Also, I use Ian Piumarta's method to import new fonts into my image as BDF
files (BTW the "getbdf" program was VERY hard to track down on the
internet, even with google).  The coolest part is that I found a utility
called xmbdfed which allowed me to take my favorite fonts and Squeakify
them (change underscore to left arrow etc.).  Once all this was done my
environment is pretty close to what I want, and I'm sure I can tweak it
some more to make it exactly what I want.

Sorry to bother all you experts with my Squeak growing pains ;-)  Thanks
for your help.

Mike



> From: Ned Konz <ned at bike-nomad.com>
> Date: Sun, 27 Oct 2002 22:40:24 -0700
> 
> On Sunday 27 October 2002 02:19 pm, Michael Vanier wrote:
> > Ned,
> >
> > This is cool, but unfortunately it changes text in message balloons
> > too. What I'd like is to be able to independently set the text
> > color just for (say) workspaces or browsers.  Ditto for background
> > colors.  I assume this will involve hacking the code for
> > workspaces/browsers, but I have been unable to figure out how
> > either of these get their colors.  It must be doable independently
> > because, for instance, transcript windows have different colors
> > than workspaces.
> 
> They're the same color. That is, they don't have different text 
> colors, just background colors, which are quite different.
> 
> The problem is that the PluggableTextMorph and PluggableListMorph that 
> form the basis of most of the built-in tools don't specify a text 
> color. So you get whatever the default is for StringMorph or 
> TextMorph, which is black.
> 
> If you wanted a per-tool setting, you'd have to make the Browser set 
> all of its parts' text color, and then you'd have to make PTM and PLM 
> listen to that color, rather than using the default.
> 
> You know, I assume, that you can change the background colors for the 
> various tools using the menu item "appearance/window colors" (though 
> you may have to turn off the #alternativeWindowLook preference to get 
> the colors you asked for).
> 
> I guess another strategy would be to have SystemWindow examine the 
> global color preferences like it does for background colors, and set 
> the text colors. There would still be some changes needed (hint: 
> search for senders of "black"), like the PLM change I made to 
> unhighlight.
> 
> -- 
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
> 
> 
> 



More information about the Squeak-dev mailing list