void wxMacControl::SetupTabs( const wxNotebook& notebook) { const size_t countPages = notebook.GetPageCount(); SetMaximum( countPages ) ; wxNotebookPage *page; ControlTabInfoRecV1 info; for (size_t ii = 0; ii < countPages; ii++) { page = (wxNotebookPage*) notebook.GetPage(ii); info.version = kControlTabInfoVersionOne; info.iconSuiteID = 0; wxCFStringRef cflabel( page->GetLabel(), page->GetFont().GetEncoding() ) ; info.name = cflabel ; SetData<ControlTabInfoRecV1>( ii + 1, kControlTabInfoTag, &info ) ; if ( notebook.GetImageList() && notebook.GetPageImage(ii) >= 0 ) { const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( ii ) ) ; if ( bmap.IsOk() ) { ControlButtonContentInfo info ; wxMacCreateBitmapButton( &info, bmap ) ; OSStatus err = SetData<ControlButtonContentInfo>( ii + 1, kControlTabImageContentTag, &info ); if ( err != noErr ) { wxFAIL_MSG("Error when setting icon on tab"); } wxMacReleaseBitmapButton( &info ) ; } } SetTabEnabled( ii + 1, true ) ; } }