wxStaticBitmap does not refresh Topic is solved

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
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

wxStaticBitmap does not refresh

Post by rocrail »

Hi,

on a NoteBook panel there are some static bitmaps.
This panel is not visible if an object is selected on the first NoteBook page.
After selecting an object, the static bitmaps become new assigned bitmaps by calling its function SetBitmap.
If the page is selected with the static bitmaps, they are not updated and showing still the bitmaps of the previous selected object.

The wxStaticBitmap is only updated if its visible, and won't update if its in the background.

Any work arounds for this?
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxStaticBitmap does not refresh

Post by rocrail »

Hi,

I did found a work around:

Code: Select all

void LocDialog::OnNotebookPageChanged( wxNotebookEvent& event )
{
  // Work around for updating the function bitmaps
  if( event.GetSelection() == 4 )
    initFunctions();
  event.Skip();
}
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: wxStaticBitmap does not refresh

Post by rocrail »

Just another Work Around for Linux GTK.

wxNullBitmap does not clear the previous bitmap in wxStaticBitmap.
To clear the wxStaticBitmap under Linux GTK I created an empty bitmap for this purpose which works also under Windows and macOS.
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply