[2.6.3] wxWindow(Base) and InheritAttributes (background
colour is not inherited)
Vadim Zeitlin
vadim at wxwindows.org
Sat Aug 5 08:39:36 PDT 2006
On Mon, 31 Jul 2006 18:33:39 +0200 H <H at h.com> wrote:
H> I can remove the #if 0 and it works for me but this does not mean that
H> it works for everybody.
Sure, but the fact that it works for you is still good to know.
H> If you obey what is written in the documentation with respect to
H> SetBackground and SetOwnBackground I do not see any problems anyway.
H> Probably the person who entered the #if 0 clause did not know
H> SetOwnBackground?
The problem is that SetOwnBackground() is new and plenty of existing code
uses SetBackground() when they probably need SetOwnBackground(). Seen like
this it seems like the best would be to:
1. remove the #if 0
2. make SetBackground() behave as SetOwnBackground() currently
3. add SetBackgroundRecursively() or something like that to set background
for the window and all of its children
Of course, the problem with that -- and the probably reason we didn't do
it like this from the beginning -- is that it's inconsistent with
SetForegroundColour() and SetFont() which set them recursively by default.
But then there is no problem with doing this while there is one with the
background and themes.
H> if #if 0 is kept you should remove SetBackground
Nothing can be just removed... Thousands of people using this method would
really dislike it.
H> Basically
H>
H> #if 0 together with SetBackground are identical to SetOwnBackground.
Right.
H> The documentation to wxWindow::SetBackground should be updated. Because
H> there the difference between SetBackground and SetOwnBackground is
H> described. But as there is no difference anymore the documenation is
H> wrong.
H> Also InheritAttributes' documentation has to be updated.
Right. But maybe we're going to change the code, finally... I'll forward
repost this to wx-dev to see what do the others think.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list