Set background color for wxTextEntryDialog

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Set background color for wxTextEntryDialog

Post 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
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Re: Set background color for wxTextEntryDialog

Post by archman007 »

Version 3.1.3
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Set background color for wxTextEntryDialog

Post by doublemax »

Did you try wxWindow::SetBackgroundColour?
https://docs.wxwidgets.org/trunk/classw ... d83b25d8a0
Use the source, Luke!
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Re: Set background color for wxTextEntryDialog

Post by archman007 »

wxTextEntryDialog dlg(



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

both attempts failed.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Set background color for wxTextEntryDialog

Post 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.
Use the source, Luke!
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Re: Set background color for wxTextEntryDialog

Post 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
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Set background color for wxTextEntryDialog

Post 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.
Use the source, Luke!
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Re: Set background color for wxTextEntryDialog

Post 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
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Set background color for wxTextEntryDialog

Post 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.
Use the source, Luke!
User avatar
archman007
Experienced Solver
Experienced Solver
Posts: 55
Joined: Mon Jan 13, 2020 1:06 pm
Location: Jacksonville, Fl 32210
Contact:

Re: Set background color for wxTextEntryDialog

Post by archman007 »

Thank you for responding.

You da man!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Set background color for wxTextEntryDialog

Post by ONEEYEMAN »

Hi,
It also might depend on the theme (just a suggestion).

Thank you.
Post Reply