inheritable colours again

Vadim Zeitlin vadim at wxwindows.org
Sat Aug 5 08:48:40 PDT 2006


 Hello,

 I thought we fixed this problem already but as the thread starting from

	http://article.gmane.org/gmane.comp.lib.wxwindows.general/45397

demonstrates, we didn't. Basically the problem is that it seems to be
currently impossible to make the background colour to apply to the window
and all of its children -- unlike, for example, foreground colour or font.

 I see the following solutions:

1. The one I proposed in the thread above, that is add new SetBgRecursive()
   method which would work as expected and change SetBackgroundColour() to
   behave as SetOwnBackgroundColour() currently does:

   + Allows to change the background for the entire panel/dialog at once
   + Compatible with the current code
   - SetBackgroundColour() inconsistent with SetForegroundColour()
   - SetOwnBackgroundColour() becomes useless (same as SetBackgroundColour())

2. Remove/deprecate SetOwnBackgroundColour(), document that
   SetBackgroundColour() doesn't change the children background explaining
   that it's a bad idea with modern themed GUIs

   + Simplest
   - SetBackgroundColour() inconsistent with SetForegroundColour()
   - Doesn't allow to change the background of the entire dialog at once

3. Let SetBackgroundColour() behave as SetForegroundColour(), i.e. change
   the colour for the window and all its descendants at once.

   + Allows to change the background for the entire panel/dialog at once
   + All methods behave in consistent way
   - Incompatible with the current behaviour


 What would you prefer? My order is probably 1,3,2. Or is there something
else/better to do?

 Thanks,
VZ





More information about the wx-dev mailing list