Window colours

Frank Shearar Frank.Shearar at rnid.org.uk
Wed Mar 2 14:13:13 UTC 2005


Ned Konz <ned at squeakland.org> wrote:
> 
> On Tuesday 01 March 2005 8:51 am, Frank Shearar wrote:
> > Is it better form to override #defaultBackgroundColor or to 
> "Preferences
> > setWindowColorFor: Foo name to: someColor" in Foo class>>initialize?
> >
> > In the latter case, we'd of course call "Preferences 
> windowColorFor: self
> > class name" in our Foo>>openWindowTypeOfMethod.
> 
> You shouldn't override defaultBackgroundColor.
> 
> And there's no reason to do a setWindowColorFor:to: if you put a 
> #windowColorSpecification in the class side of the model 
> class. In fact, 
> doing a #setWindowColorFor:to: is rude, as it overrules the 
> user's own window 
> color settings.

Ah, indeed, it is rude. I'd not thought of that. I'll make sure my Models behave themselves.

<snip>

> The window opening (assuming you're opening a SystemWindow) 
> will look up the 
> window color itself. If you're getting a color for a 
> non-SystemWindow, you 
> would do it as you describe.

I see that sending one of the #open* messages calls #paneColor which, under some conditions (model notNil being the most important), will ask the model for its #defaultBackgroundColor.

I can't see how it gets the window colour from the #windowColourSpecification though. MethodFinder gives me three senders: Finder class>>windowColourSpecification just delegates to RefactoringBrowser class>>windowColourSpecification, TestRunner class>>initialize does The Rude Thing and calls Preferences class>>setWindowColorFor:to: and Preferences class>>windowColorTable just returns an Array containing implementors of #windowColorSpecification...

Thanks for the answers, Ned!

frank


*******************************************************************
This email and attachments (if any) must be swept for viruses before opening. Their contents may be confidential or privileged and are intended solely for the named recipient. If you are not the intended recipient and you have received this email in error you must not read or use this email and should notify RNID on: +44 (0) 20 7296 8282.

 

RNID, Registered Office 19-23 Featherstone Street, London EC1Y 8SL No. 454169 (England, Registered Charity No. 207720)

********************************************************************




More information about the Squeak-dev mailing list