- Rect bounds ;
- Str255 title ;
-
- m_imageList = NULL;
-
- MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
-
- m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
- kControlTabSmallProc , (long) this ) ;
-
- MacPostControlCreate() ;
- return TRUE ;
+ Rect bounds = wxMacGetBoundsForControl( this, pos, size );
+
+ UInt16 tabstyle = kControlTabDirectionNorth;
+ ControlTabSize tabsize = kControlTabSizeLarge;
+ if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
+ tabsize = kControlTabSizeSmall ;
+ else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
+ {
+ tabsize = 3 ;
+ }
+
+ m_peer = new wxMacControl( this );
+ OSStatus err = CreateTabsControl(
+ MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
+ tabsize, tabstyle, 0, NULL, m_peer->GetControlRefAddr() );
+ verify_noerr( err );
+
+ MacPostControlCreate( pos, size );
+
+ return true;