         }
 
         self.selectedButton = button
-        self.tabButtons().forEach { $0.state = ($0 === self.selectedButton!) ? NSOnState : NSOffState }
-        
+        let tabButtons = self.tabButtons()
+        tabButtons.forEach { $0.state = ($0 === self.selectedButton!) ? NSOnState : NSOffState }
+        layoutTabButtons(tabButtons, animated: false)
+
         NSApp.sendAction(self.action, to: self.target, from: self)
         NSNotificationCenter.defaultCenter().postNotificationName(TabsControlSelectionDidChangeNotification, object: self)
         

    private var addButton: NSButton? = nil
    private var scrollLeftButton: NSButton? = nil
    private var scrollRightButton: NSButton? = nil
    private weak var selectedButton: TabButton? = nil

    private var hideScrollButtons: Bool = true
//    private var isHighlighted: Bool = false

        defer { self.reloadTabs() }
        
        guard !newValue.isEmpty
            && self.delegate?.tabsControl?(self, setTitle: newValue, forItem: tabButton.representedObject!) != nil,
            let selectedItemIndex = self.selectedItemIndex
            else { return }
        
        // TODO add callback to client code to replace forwarding controlTextDidEndEditing(_:)
        
        tabButton.representedObject = self.dataSource?.tabsControl(self, itemAtIndex: selectedItemIndex)
    }

    // MARK: - Drawing
