diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index f77f277ca6..9e5bb9fe0b 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -229,6 +229,15 @@ public: // returns true if the platform should explicitly apply a theme border virtual bool CanApplyThemeBorder() const wxOVERRIDE { return false; } + + // Implementation only from now on. + + // Returns an empty bundle if no image is specified for this page. + wxBitmapBundle GetPageBitmapBundle(size_t n) const + { + return GetBitmapBundle(GetPageImage(n)); + } + protected: // flags for DoSetSelection() enum diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index 766ecd2b1b..45a86b2a13 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -22,7 +22,7 @@ #endif #include "wx/string.h" -#include "wx/imaglist.h" +#include "wx/private/bmpbndl.h" #include "wx/osx/private.h" // @@ -266,13 +266,11 @@ public: [item setView:page->GetHandle() ]; wxCFStringRef cf( page->GetLabel() , notebook.GetFont().GetEncoding() ); [item setLabel:cf.AsNSString()]; - if ( notebook.GetImageList() && notebook.GetPageImage(i) >= 0 ) + + const wxBitmapBundle bitmap = notebook.GetPageBitmapBundle(i); + if ( bitmap.IsOk() ) { - const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( i ) ) ; - if ( bmap.IsOk() ) - { - [(WXCTabViewImageItem*) item setImage: bmap.GetNSImage()]; - } + [(WXCTabViewImageItem*) item setImage: wxOSXGetImageFromBundle(bitmap)]; } } }