Issue of changing background color of wxAuiToolbar

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
csniper
Experienced Solver
Experienced Solver
Posts: 53
Joined: Mon Mar 13, 2017 8:27 am

Issue of changing background color of wxAuiToolbar

Post by csniper »

I tried to change wxAuiToolbar by calling SetBackgroundColour and Refresh as the same as the sample code of wxToolBar in the toolbar sample. It did not work.

I'm not sure if I missed something or it's a bug.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue of changing background color of wxAuiToolbar

Post by PB »

It seems that this would need to be done via a custom wxAuiToolBarArt provider, overriding Draw(Plain)Background and possibly other methods.
csniper
Experienced Solver
Experienced Solver
Posts: 53
Joined: Mon Mar 13, 2017 8:27 am

Re: Issue of changing background color of wxAuiToolbar

Post by csniper »

Sounds like the function was not supported. Why was it not added while refactoring wxAui.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Issue of changing background color of wxAuiToolbar

Post by PB »

csniper wrote:Sounds like the function was not supported. Why was it not added while refactoring wxAui.
Just mere existence of an inherited method does not guarantee anything. For example, many controls ignore Set(Background)Colour() as the underlying native control does not support it, this can differ even between the platforms for the same control.

Anyway, wxAUI is one of the parts of wxWidgets (just like e.g. wxRibbon) that uses the art-provider concept, probably because its drawing is rather complex and just Set(Background)Colour() is not sufficient...
Post Reply