Revert "Remove unused code in wxGTK wxAnyButton"

This reverts commit 4e366b2cfb as it the
code removed by it is still needed and removing it results in unit test
failures in wxBitmapToggleButton unit tests with both GTK 2 and 3.

See https://github.com/wxWidgets/wxWidgets/pull/2548
This commit is contained in:
Vadim Zeitlin
2021-10-17 23:56:28 +02:00
parent 411cad6cd9
commit d4bc1daf19

View File

@@ -186,7 +186,10 @@ void wxAnyButton::GTKDoShowBitmap(const wxBitmap& bitmap)
{
wxCHECK_RET(bitmap.IsOk(), "invalid bitmap");
GtkWidget* const image = gtk_button_get_image(GTK_BUTTON(m_widget));
GtkWidget* image = gtk_button_get_image(GTK_BUTTON(m_widget));
if (image == NULL)
image = gtk_bin_get_child(GTK_BIN(m_widget));
wxCHECK_RET(WX_GTK_IS_IMAGE(image), "must have image widget");
WX_GTK_IMAGE(image)->Set(bitmap);