+        
+        // update the item positioning state
+        if ( !isHorizontal )
+            y += cursize.y + kwxMacToolSpacing;
+        else
+            x += cursize.x + kwxMacToolSpacing;
+        
+        node = node->GetNext();
+    }
+    
+    if ( isHorizontal )
+    {
+        // if not set yet, only one row
+        if ( m_maxRows <= 0 )
+            SetRows( 1 );
+        
+        maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
+        m_minWidth = maxWidth;
+        m_minHeight = m_maxHeight = maxToolHeight + 2 * (m_yMargin + kwxMacToolBarTopMargin);
+    }
+    else
+    {
+        // if not set yet, have one column
+        if ( (GetToolsCount() > 0) && (m_maxRows <= 0) )
+            SetRows( GetToolsCount() );
+        
+        maxHeight += m_yMargin + kwxMacToolBarTopMargin;
+        m_minHeight = maxHeight;
+        m_minWidth = m_maxWidth = maxToolWidth + 2 * (m_yMargin + kwxMacToolBarTopMargin);
+    }
+    
+    int totalStretchableSpace = 0;
+    int spacePerStretchable = 0;
+    if ( numStretchableSpaces > 0 )
+    {
+        if ( isHorizontal )
+            totalStretchableSpace = tw - maxWidth;
+        else
+            totalStretchableSpace = th - maxHeight;
+        
+        if ( totalStretchableSpace > 0 )
+            spacePerStretchable = totalStretchableSpace / numStretchableSpaces;            
+    }
+    
+    // perform real positioning
+    
+    x = m_xMargin + kwxMacToolBarLeftMargin;
+    y = m_yMargin + kwxMacToolBarTopMargin;
+    
+    node = m_tools.GetFirst();
+    int currentStretchable = 0;
+    while ( node )
+    {
+        tool = (wxToolBarTool*) node->GetData();
+        if ( tool == NULL )
+        {
+            node = node->GetNext();
+            continue;
+        }
+        
+        wxSize  cursize = tool->GetSize();
+        if ( tool->IsStretchableSpace() )
+        {
+            ++currentStretchable;
+            int thisSpace = currentStretchable == numStretchableSpaces ? 
+            totalStretchableSpace - (currentStretchable-1)*spacePerStretchable :
+            spacePerStretchable;
+            if ( isHorizontal )
+                cursize.x += thisSpace;
+            else 
+                cursize.y += thisSpace;
+        }
+        
+        if ( !isHorizontal )