I'm having trouble with wxWidgets 3.0.4, running on Windows10 and Debian Linux.
In Windows, textlabel background take on the assigned color, as expected.
However, when the exact same set-up is used in Linux (Debian), the textlabel
background does not take on the assigned color (even with Refresh() performed).
I thought the problem was wxWidgets versions, being 3.0.4 on Windows and 3.0.2
on Debian, but building and using 3.0.4 on Debian made no difference.
I read somewhere that this might be a Gtk issue, where Linux textlabel background
meant only the borders and not the solid background itself. By comparison, buttons
do the same thing under Windows and Linux, having background doing a solid fill in
either environment.
I need the same project running on both Windows and Linux. I was hoping the same
features worked the same way on all platforms. The textlabel background color works
great on Windows for my needs. Why won't it do the same thing on Linux?
Any suggestions on how to fix this?
Thanks for all help.
Inconsistent handling of textlabel background color in 3.0
Re: Inconsistent handling of textlabel background color in 3.0
I assume you're talking about wxStaticText?
Try wxGenericStaticText instead:
Try wxGenericStaticText instead:
Code: Select all
#include <wx/generic/stattextg.h>
...
wxGenericStaticText *gstc = new wxGenericStaticText( panel, wxID_ANY, "some text", wxPoint(10,90), wxSize(200,-1) );
gstc->SetBackgroundColour( *wxRED );
Use the source, Luke!
Re: Inconsistent handling of textlabel background color in 3.0
HI,
To answer your question:
wxWidgets is known to be a native library. It means that it will use a native control implementation whenever possible.
So if *nix/GTK does not support something wxWidgets can't do anything. You have a choice of either use generic control, as doublemax suggested, or leave with it.
Thank you.
To answer your question:
wxWidgets is known to be a native library. It means that it will use a native control implementation whenever possible.
So if *nix/GTK does not support something wxWidgets can't do anything. You have a choice of either use generic control, as doublemax suggested, or leave with it.
Thank you.
Re: Inconsistent handling of textlabel background color in 3.0
Thanks for the wxGenericStaticText suggestion. Works great, as background colors
are showing.
I hand-edited the source and changed wxStaticText to wxGenericStaticText
where appropriate. I don't suppose it's easy to add this widget to the wxSmith/Codeblocks
IDE I'm using, since it's not included. (I know this belongs to a Codeblocks forums discussion,
but perhaps someone in this forum has done this before and can offer advice/insight).
Or, perhaps generic controls don't belong in wxSmith?
Also thanks for the clarification about the native library and generic controls.
are showing.
I hand-edited the source and changed wxStaticText to wxGenericStaticText
where appropriate. I don't suppose it's easy to add this widget to the wxSmith/Codeblocks
IDE I'm using, since it's not included. (I know this belongs to a Codeblocks forums discussion,
but perhaps someone in this forum has done this before and can offer advice/insight).
Or, perhaps generic controls don't belong in wxSmith?
Also thanks for the clarification about the native library and generic controls.