]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/bitmap.cpp
The standalone PyShell and PyCrust apps need to set the focus to the
[wxWidgets.git] / src / motif / bitmap.cpp
index e5b3c2c3086a44c67ae933dea32a1d8604f08fa2..bace224758e891c5af9ee75f6400cabf07cf6dac 100644 (file)
@@ -143,7 +143,7 @@ wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
     (void) Create(data, type, width, height, depth);
 }
 
-wxBitmap::wxBitmap(const wxString& filename, long type)
+wxBitmap::wxBitmap(const wxString& filename, int type)
 {
     LoadFile(filename, (int)type);
 }
@@ -211,7 +211,7 @@ bool wxBitmap::LoadFile(const wxString& filename, long type)
         if (!image.LoadFile( filename, type )) return FALSE;
         if (image.Ok()) 
         {
-            *this = image.ConvertToBitmap();
+            *this = wxBitmap(image);
             return TRUE;
         }
         else return FALSE;
@@ -242,7 +242,7 @@ bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *pal
     wxBitmapHandler *handler = FindHandler(type);
 
     if ( handler == NULL ) { // try wxImage
-        wxImage image( *this );
+        wxImage image = this->ConvertToImage();
         if (image.Ok()) return image.SaveFile( filename, type );
         else return FALSE;
     }
@@ -829,6 +829,8 @@ void wxBitmap::InitStandardHandlers()
 
 WXPixmap wxBitmap::GetLabelPixmap (WXWidget w)
 {
+    if (!M_BITMAPDATA)
+        return (WXPixmap)NULL;
     if (M_BITMAPDATA->m_image == (WXPixmap) 0)
         return M_BITMAPDATA->m_pixmap;
 
@@ -905,7 +907,9 @@ WXPixmap wxBitmap::GetArmPixmap (WXWidget w)
 WXPixmap wxBitmap::GetInsensPixmap (WXWidget w)
 {
     Display *dpy = (Display*) M_BITMAPDATA->m_display;
-
+    
+    if (!M_BITMAPDATA)
+        return (WXPixmap)NULL;
     if (M_BITMAPDATA->m_insensPixmap)
         return M_BITMAPDATA->m_insensPixmap;