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
const char* stockid;
if (bitmap.IsOk())
{
- GtkWidget* image;
- if (bitmap.HasPixbuf())
- image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
- else
- {
- GdkPixmap* mask = NULL;
- if (bitmap.GetMask())
- mask = bitmap.GetMask()->GetBitmap();
- image = gtk_image_new_from_pixmap(bitmap.GetPixmap(), mask);
- }
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ GtkWidget* image = gtk_image_new_from_pixbuf(bitmap.GetPixbuf());
menuItem = gtk_image_menu_item_new_with_label("");
gtk_widget_show(image);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), image);
#include "wx/statbmp.h"
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
// wxStaticBitmap
if (m_bitmap.Ok())
{
- GdkBitmap *mask = (GdkBitmap *) NULL;
- if (m_bitmap.GetMask())
- mask = m_bitmap.GetMask()->GetBitmap();
-
- if (m_bitmap.HasPixbuf())
- {
- gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget),
- m_bitmap.GetPixbuf());
- }
- else
- gtk_image_set_from_pixmap(GTK_IMAGE(m_widget),
- m_bitmap.GetPixmap(), mask);
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget), m_bitmap.GetPixbuf());
InvalidateBestSize();
SetSize(GetBestSize());
GtkWidget* image = ((GtkBin*)m_widget)->child;
if (image == NULL)
{
- // initial bitmap
- image = gtk_image_new_from_pixbuf(m_bitmap.GetPixbuf());
+ image = gtk_image_new();
gtk_widget_show(image);
gtk_container_add((GtkContainer*)m_widget, image);
}
- else
- { // subsequent bitmaps
- gtk_image_set_from_pixbuf((GtkImage*)image, m_bitmap.GetPixbuf());
- }
+ // always use pixbuf, because pixmap mask does not
+ // work with disabled images in some themes
+ gtk_image_set_from_pixbuf((GtkImage*)image, m_bitmap.GetPixbuf());
}
bool wxBitmapToggleButton::Enable(bool enable /*=true*/)