Hello,
I am on OSX 12.2, wxWidgets 3.1.5, and I am running a C++ code with wxWidgets.
I would like to obtain the default background color that the operating system sets to fill the rectangle of a wxComboBox. Do you know how to get it?
I tried with wxSystemSettings::GetColour(wxSystemColour index) by setting, for example index = wxSYS_COLOUR_LISTBOX, but I don't get the right color.
Thank you !
Obtain background color of wxComboBox set by the operating system
-
- Earned some good credits
- Posts: 108
- Joined: Mon Feb 07, 2022 11:53 am
Re: Obtain background color of wxComboBox set by the operating system
There is no guarantee that there is a wxSystemColour index for every possible color used by the OS.
And as soon as an OS uses a gradient or any other graphical effects, a single color won't work anyway.
Even if i repeat myself: As soon as you're messing with the colors of native controls, you're on the path of evil
(And very likely to create a bad GUI)
And as soon as an OS uses a gradient or any other graphical effects, a single color won't work anyway.
Even if i repeat myself: As soon as you're messing with the colors of native controls, you're on the path of evil
(And very likely to create a bad GUI)
Use the source, Luke!
Re: Obtain background color of wxComboBox set by the operating system
Hi,
Try to compile the latest release.
I think there is some work done about the "dark mode"...
Thank you.
Try to compile the latest release.
I think there is some work done about the "dark mode"...
Thank you.
-
- Earned some good credits
- Posts: 108
- Joined: Mon Feb 07, 2022 11:53 am
Re: Obtain background color of wxComboBox set by the operating system
Hello,doublemax wrote: ↑Mon Sep 26, 2022 8:29 pm There is no guarantee that there is a wxSystemColour index for every possible color used by the OS.
And as soon as an OS uses a gradient or any other graphical effects, a single color won't work anyway.
Even if i repeat myself: As soon as you're messing with the colors of native controls, you're on the path of evil
(And very likely to create a bad GUI)
I found a solution to extract the background set by the OS. I create a dummy wxListControl, with size zero, and run GetBackgroundColour() on it. This works fine, although is not elegant ...