Page 1 of 1

wxButtons with Image Flicker on Frame Resize.

Posted: Sun Sep 16, 2018 12:52 pm
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?

Re: wxButtons with Image Flicker on Frame Resize.

Posted: Sun Sep 16, 2018 3:28 pm
by purplex88
Yes, adding wxPanel solved it. I wasn't sure why I needed it though.