- wxSize size = s ;
- /*
- if ( size.x == wxDefaultCoord && size.y == wxDefaultCoord)
- {
- size = wxSize( 200 , 16 ) ;
- }
- */
- Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
- m_peer = new wxMacControl() ;
- verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
- GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) );
-
-
- MacPostControlCreate(pos,size) ;
-
- return TRUE;
+ wxSize size = s;
+
+#if 0
+ if (size.x == wxDefaultCoord && size.y == wxDefaultCoord)
+ size = wxSize( 200 , 16 );
+#endif
+
+ Rect bounds = wxMacGetBoundsForControl( this, pos, size );
+ m_peer = new wxMacControl( this );
+ OSStatus err = CreateProgressBarControl(
+ MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
+ GetValue(), 0, GetRange(), false /* not indeterminate */, m_peer->GetControlRefAddr() );
+ verify_noerr( err );
+
+ if ( GetValue() == 0 )
+ m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, (Boolean)false );
+
+ MacPostControlCreate( pos, size );
+
+ return true;