wxButtons with Image Flicker on Frame Resize.

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
purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

wxButtons with Image Flicker on Frame Resize.

Post by purplex88 »

I have several wxButtons placed on wxFrame for which I set Bitmap images.

Code: Select all

wxBitmap Bitmap1(....)
m_button1 = new wxButton(this, BUTTON1_ID, wxT(""), wxDefaultPosition, wxDefaultSize, wxTRANSPARENT_WINDOW | wxBORDER_NONE);
m_button1->SetBitmap(Bitmap1);
The problem is when I resize the wxFrame, all the buttons wit bitmap flicker a lot.

I found this guide here: https://wiki.wxwidgets.org/Flicker-Free_Drawing and used

Code: Select all

SetDoubleBuffered(true);
inside wxFrame's constructor but that didn't solve it.

One thing I noticed that I am not using wxPanel for wxFrame on which buttons are placed. Would that solve it?
purplex88
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 247
Joined: Mon Feb 24, 2014 3:14 pm

Re: wxButtons with Image Flicker on Frame Resize.

Post by purplex88 »

Yes, adding wxPanel solved it. I wasn't sure why I needed it though.
Post Reply