+/* Added by Mark Newsam
+ * When a page is added or deleted to the notebook this function updates
+ * information held in the m_macControl so that it matches the order
+ * the user would expect.
+ */
+void wxNotebook::MacSetupTabs()
+{
+ SetControlMaximum( m_macControl , GetPageCount() ) ;
+
+ wxNotebookPage *page;
+ ControlTabInfoRec info;
+ Boolean enabled = true;
+ for(int ii = 0; ii < GetPageCount(); ii++)
+ {
+ page = m_pages[ii];
+ info.version = 0;
+ info.iconSuiteID = 0;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) info.name , page->GetLabel() ) ;
+#else
+ strcpy( (char *) info.name , page->GetLabel() ) ;
+ c2pstr( (char *) info.name ) ;
+#endif
+ SetControlData( m_macControl, ii+1, kControlTabInfoTag,
+ sizeof( ControlTabInfoRec) , (char*) &info ) ;
+ SetControlData( m_macControl, ii+1, kControlTabEnabledFlagTag,
+ sizeof( Boolean ), (Ptr)&enabled );
+ }
+ Rect bounds;
+ GetControlBounds(m_macControl, &bounds);
+ InvalWindowRect(MacGetRootWindow(), &bounds);