Fix creating wxButton using stock id with GTK

Broken by 85d63c3150 (Add a class derived from GtkImage to support HiDPI bitmaps, 2020-09-15)
See #19288
This commit is contained in:
Paul Cornett
2021-10-13 22:37:11 -07:00
parent 700dd3e905
commit e9bf514976
2 changed files with 5 additions and 1 deletions

View File

@@ -31,3 +31,4 @@ public:
};
#define WX_GTK_IMAGE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, wxGtkImage::Type(), wxGtkImage)
#define WX_GTK_IS_IMAGE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, wxGtkImage::Type())

View File

@@ -192,7 +192,10 @@ void wxAnyButton::GTKDoShowBitmap(const wxBitmap& bitmap)
wxCHECK_RET(GTK_IS_IMAGE(image), "must have image widget");
WX_GTK_IMAGE(image)->Set(bitmap);
if (WX_GTK_IS_IMAGE(image))
WX_GTK_IMAGE(image)->Set(bitmap);
else
gtk_image_set_from_pixbuf(GTK_IMAGE(image), bitmap.GetPixbuf());
}
wxBitmap wxAnyButton::DoGetBitmap(State which) const