I recently started learning C++ and wxWidgets and now I'm building a calculator program. I want to know how to change the background of my main frame with light grey colour and I want it to be a little bit transparent, like on windows calculator.
Asked
Active
Viewed 947 times
1
-
did you try the usual `SetBackgroundColour()` on the main frame? – Igor Jun 18 '20 at 15:32
-
1[SetTransparent](https://docs.wxwidgets.org/trunk/classwx_window.html#ac8cf4398cec50ac36634760f45a0656f). Also look in this [wxWindow class doc](https://docs.wxwidgets.org/trunk/classwx_window.html) for `XXXSetBackgroundYYY` functions. – Ripi2 Jun 18 '20 at 17:36
-
@Ripi2 Thanks, it helped me to add transparency. When I compared my calculator to windows one, I noticed that it blurs the background. If I set transparency on my calculator to similar windows value I can clearly see all things behind the program unlike on windows calculator. Do you know how to blur the background? – Michael Chon Jun 18 '20 at 18:39
-
2Assuming you have the background in an image, SO offers some answers like [this](https://stackoverflow.com/questions/42363726/bluring-an-image-in-c-c). If not, then the proccess is more tricky: You have to draw, get the background (sort of "screen snap"), blur it and then set as background (no need transparency in this second SetBackground use) – Ripi2 Jun 18 '20 at 23:03