]> git.saurik.com Git - wxWidgets.git/commitdiff
Mac doesn't like getting an icon if it's a bitmap
authorJulian Smart <julian@anthemion.co.uk>
Tue, 31 Jan 2006 16:22:54 +0000 (16:22 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 31 Jan 2006 16:22:54 +0000 (16:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/toolbkg.cpp

index f40261c4e3b71a1becc4f3eb2439158591e57f67..af7d3f2c9ea64187d376ffaf5eaced95d6b75357 100644 (file)
@@ -319,10 +319,16 @@ wxToolbook::InsertPage(size_t n,
     if (!GetImageList())
         return false;
 
+    // TODO: make sure all platforms can convert between icon and bitmap,
+    // and/or test whether the image is a bitmap or an icon.
+#ifdef __WXMAC__
+    wxBitmap bitmap = GetImageList()->GetBitmap(imageId);
+#else
     // On Windows, we can lose information by using GetBitmap, so extract icon instead
     wxIcon icon = GetImageList()->GetIcon(imageId);
     wxBitmap bitmap;
     bitmap.CopyFromIcon(icon);
+#endif
     
     m_maxBitmapSize.x = wxMax(bitmap.GetWidth(), m_maxBitmapSize.x);
     m_maxBitmapSize.y = wxMax(bitmap.GetHeight(), m_maxBitmapSize.y);