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:
@@ -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())
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user