changing background of button from its default - mac

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
Yena
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Dec 16, 2020 10:48 am
Contact:

changing background of button from its default - mac

Post by Yena »

Happy new years everyone!

I'm developing a GUI on mac, and I'm having trouble trying to have the button options contrast from the background of the window.
Screen Shot 2021-01-01 at 3.10.07 AM.png
Screen Shot 2021-01-01 at 3.10.07 AM.png (22.74 KiB) Viewed 1151 times
Does anyone know how to darken the button background from its default, and differentiate it from the white text within the box? Thank you!
Kvaz1r
Super wx Problem Solver
Super wx Problem Solver
Posts: 357
Joined: Tue Jun 07, 2016 1:07 pm

Re: changing background of button from its default - mac

Post by Kvaz1r »

Did you try set SetBackgroundColour for background and set SetForegroundColour for text?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: changing background of button from its default - mac

Post by ONEEYEMAN »

Hi,
Do you use a different theme?

Thank you
Yena
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Dec 16, 2020 10:48 am
Contact:

Re: changing background of button from its default - mac

Post by Yena »

Thanks, I was able to change the button color like so:
Screen Shot 2021-01-02 at 2.08.27 AM.png
Screen Shot 2021-01-02 at 2.08.27 AM.png (24.6 KiB) Viewed 1100 times
with the following code:

Code: Select all

    wxButton * wxButton2 = new wxButton(page, wxID_EXIT, wxT("Quit"), wxPoint( 490,300 ), wxDefaultSize, 0);
    sizerPage2->Add(wxButton2, flagsBorder);
    wxButton2->SetBackgroundColour(wxColour(99, 110, 114));
However, I'm trying to crop off the gray color from the corners, so it only encapsulates the button itself. Is there a way to do this?
Post Reply