Page 1 of 1

Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 12:36 pm
by archman007
Hello Folks,

I would like to change the background color for the wxTextEntryDialog.

I checked in this forum but did not find any examples.

How do I do that?

Thanks in Advance

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 12:40 pm
by archman007
Version 3.1.3

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 1:08 pm
by doublemax
Did you try wxWindow::SetBackgroundColour?
https://docs.wxwidgets.org/trunk/classw ... d83b25d8a0

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 2:12 pm
by archman007
wxTextEntryDialog dlg(



this, prompt, caption, wxInit,
(wxCANCEL | wxOK | wxTE_MULTILINE), wxPoint(50, 50));
this->SetBackgroundColour( * wxBLUE);
//dlg.SetBackgroundColour( * wxBLUE);

both attempts failed.

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 2:19 pm
by doublemax

Code: Select all

dlg.SetBackgroundColour( * wxBLUE);
That's the right one and works for me under Windows. What plaform are you on? If it's OSX, there's a good chance that you can't change the color. Apple is very strict about what's proper GUI design and what's not. And yes, changing the background of any window is a bad design decision 99% of the time on any platform.

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 2:26 pm
by archman007
Operating System: Kubuntu 20.10
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Kernel Version: 5.8.0-19-generic
OS Type: 64-bit
Processors: 6 × Intel® Core™ i5-8600K CPU @ 3.60GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630

Here is my configuration.

Thanks

Re: Set background color for wxTextEntryDialog

Posted: Fri Sep 25, 2020 3:19 pm
by doublemax
Try creating a wxDialog and try to change its background color. If that doesn't work, put a wxPanel on the dialog and set its background color. If any of these two work, you can at least build a new text entry dialog from scratch.

Re: Set background color for wxTextEntryDialog

Posted: Sat Sep 26, 2020 1:03 pm
by archman007
While waiting for responses I began that process. The only drawback is when it time to select a file or directory that would be labor intensive. It make more sense to change the background color for the standard dialogs. The degree of difficulty to accomplish this is very high but is should not be.

The source is lacking.

Thanks

Re: Set background color for wxTextEntryDialog

Posted: Sat Sep 26, 2020 3:34 pm
by doublemax
My suggestion was only meant for small dialogs like wxTextEntry. I believe this is another *ubuntu oddity, i tested this on Q4OS (I usually don't use Linux, this was the only running Linux system i had at hand), and i could change the background color.

Re: Set background color for wxTextEntryDialog

Posted: Sat Sep 26, 2020 10:00 pm
by archman007
Thank you for responding.

You da man!

Re: Set background color for wxTextEntryDialog

Posted: Sat Sep 26, 2020 11:04 pm
by ONEEYEMAN
Hi,
It also might depend on the theme (just a suggestion).

Thank you.