]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/statbmp.cpp
Replace wxST_MARKUP style with wxControl::SetLabelMarkup().
[wxWidgets.git] / src / gtk / statbmp.cpp
index 7bc4035a1830fab6072596d42d820c8a7c7d5204..a7e372c93d22d4268560c52ca7030f95b7a970b9 100644 (file)
 
 #include "wx/statbmp.h"
 
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 // wxStaticBitmap
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap,wxControl)
-
 wxStaticBitmap::wxStaticBitmap(void)
 {
 }
@@ -38,8 +35,6 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
                              const wxPoint &pos, const wxSize &size,
                              long style, const wxString &name )
 {
-    m_needParent = TRUE;
-
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
     {
@@ -50,6 +45,7 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
     m_bitmap = bitmap;
 
     m_widget = gtk_image_new();
+    g_object_ref(m_widget);
 
     if (bitmap.Ok())
         SetBitmap(bitmap);
@@ -66,18 +62,9 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
 
     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());