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.
purplex88
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Feb 24, 2014 3:14 pm

wxButtons with Image Flicker on Frame Resize.

Postby purplex88 » Sun Sep 16, 2018 12:52 pm

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
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Feb 24, 2014 3:14 pm

Re: wxButtons with Image Flicker on Frame Resize.

Postby purplex88 » Sun Sep 16, 2018 3:28 pm

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


Return to “C++ Development”

Who is online

Users browsing this forum: Baidu [Spider] and 27 guests