m_bmpNormal = bitmap;
m_widget = gtk_button_new();
+ g_object_ref(m_widget);
if (style & wxNO_BORDER)
gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
if (!the_one.Ok())
return;
- GtkWidget *child = GTK_BIN(m_widget)->child;
- if (child == NULL)
+ GtkWidget* image = GTK_BIN(m_widget)->child;
+ if (image == NULL)
{
- // initial bitmap
- GtkWidget *pixmap =
- gtk_image_new_from_pixbuf(the_one.GetPixbuf());
-
- gtk_widget_show(pixmap);
- gtk_container_add(GTK_CONTAINER(m_widget), pixmap);
- }
- else
- { // subsequent bitmaps
- GtkImage *pixmap = GTK_IMAGE(child);
- gtk_image_set_from_pixbuf(pixmap, the_one.GetPixbuf());
+ image = gtk_image_new();
+ gtk_widget_show(image);
+ gtk_container_add(GTK_CONTAINER(m_widget), image);
}
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ gtk_image_set_from_pixbuf(GTK_IMAGE(image), the_one.GetPixbuf());
}
wxSize wxBitmapButton::DoGetBestSize() const