[I'm redirecting this to wx-users, as wx-discuss is unused, please follow
up there]
On Sun, 29 Nov 2020 05:02:44 -0800 (PST)
gunter.ko...@gmail.com wrote:
g> Dear all,
g>
g> I've created a wxPanel with a wxPanel on it whose background I want to be
g> able to highlight. Ergo in the constructor of my inner wxPanel I do a
g>
g> wxColor defaultBackgroundColor = GetBackgroundColor();
g>
g> If I want to dehighlight my panel I do a
g>
g> SetBackgroundColor(defaultBackgroundColor);
g>
g> instead.
g>
g> But on my wx3.0/GTK3 system my panel after that still is slightly darker
g> than it was originally.
g>
g> What do I do wrong? For some reason I was unable to find the right color
g> using wxSystemSettings::GetColour()
g> <
https://docs.wxwidgets.org/3.0/classwx_system_settings.html#ab252414b60f16a233bc17df2a19bd804>,
g> too...
I'm not sure what is the problem here, have you tried examining
defaultBackgroundColor and the actual colour on the screen? Maybe it
doesn't use a solid colour at all? This would explain why representing it
as wxColour doesn't work.
However I think you can make this work correctly and simplify your code by
just doing SetBackgroundColour(wxColour()) instead because resetting the
colour to invalid value is supposed to mean that the default background
should be used.
Regards,
VZ