From c5f023a82940a546766a0e9aabcc0fa2cf05a749 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Nov 2021 18:31:19 +0100 Subject: [PATCH] Fix wxGTK1 build after wxBitmapBundle changes in wxStaticBitmap This should have been done in 3abec9254f (Take wxBitmapBundle in wxStaticBitmap::SetBitmap(), 2021-10-21) but was forgotten there. --- include/wx/gtk1/statbmp.h | 2 +- src/gtk1/statbmp.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wx/gtk1/statbmp.h b/include/wx/gtk1/statbmp.h index 8ece6c37af..6763b95c90 100644 --- a/include/wx/gtk1/statbmp.h +++ b/include/wx/gtk1/statbmp.h @@ -34,7 +34,7 @@ public: long style = 0, const wxString& name = wxASCII_STR(wxStaticBitmapNameStr)); - virtual void SetBitmapBundle( const wxBitmapBundle& bitmap ); + virtual void SetBitmap( const wxBitmapBundle& bitmap ); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp index a20b3bd5ca..d83605fa9c 100644 --- a/src/gtk1/statbmp.cpp +++ b/src/gtk1/statbmp.cpp @@ -51,14 +51,14 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmapBund return false; } - m_bitmap = bitmap; - m_bitmapBundle = bitmap; - - wxBitmap bmp(bitmap.IsOk() ? bitmap : wxBitmap(bogus_xpm)); - m_widget = gtk_pixmap_new(bmp.GetPixmap(), NULL); - if (bitmap.IsOk()) - SetBitmap(bitmap); + { + m_bitmap = bitmap.GetBitmapFor(this); + m_bitmapBundle = bitmap; + } + + wxBitmap bmp(m_bitmap.IsOk() ? m_bitmap : wxBitmap(bogus_xpm)); + m_widget = gtk_pixmap_new(bmp.GetPixmap(), NULL); PostCreation(size); m_parent->DoAddChild( this );