grey border around buttons when placed on white background Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

grey border around buttons when placed on white background

Post by Vexator » Mon Jun 05, 2006 11:39 am

i placed a button on a white background, but there was still a grey border around it. so i called setbackgroundcolour( *wxWHITE ), which got rid of the border, but now the label had a white background..

Image

i looked into the wx source and commented out makeownerdrawn() in the setbackgroundcolour() function:

Code: Select all

bool wxButton::SetBackgroundColour(const wxColour &colour)
{
    if ( !wxControl::SetBackgroundColour(colour) )
    {
        // nothing to do
        return false;
    }

    //MakeOwnerDrawn();

    Refresh();

    return true;
}
now it works the way it should..
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Mon Jun 05, 2006 12:02 pm

You should submit this as a patch to the SF bugtracker. It seems to be a bug, clearly.

With regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

remenic
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Jun 29, 2006 8:32 am

Post by remenic » Thu Jun 29, 2006 9:04 am

Is this really a proper fix though? And why do I need to call this on every button?

What if I want to change the color of the button itself. With this hack, that can't be done anymore.

Post Reply