     
     // MARK: - Actions
     
+    func scrollTabView(sender: AnyObject?) {
+        let forLeft = (sender as? NSButton == self.scrollLeftButton)
+        let tab = self.tabButtons().filter({ self.visibilityCondition($0, forLeft: forLeft) }).first
+            
+        if (tab != nil) {
+            NSAnimationContext.runAnimationGroup({ (context) in
+                context.allowsImplicitAnimation = true
+                tab?.scrollRectToVisible(tab!.bounds)
+                }, completionHandler: {
+                    self.invalidateRestorableState()
+            })
+        }
+    }
+    
+    func visibilityCondition(button: NSButton, forLeft: Bool) -> Bool {
+        let visibleRect = self.tabsView!.visibleRect
+        if forLeft == true {
+            return NSMinX(button.frame) < NSMinX(visibleRect)
+        }
+        else {
+            return NSMaxX(button.frame) > NSMaxX(visibleRect) - 2.0*NSWidth(self.scrollLeftButton!.frame)
+        }
+    }
+    
     // MARK: - Reordering
     
     // MARK: - Selection
     
     func selectTab(sender: AnyObject?) {
-        
+        guard let button = sender else {
+            return
+        }
+        self.selectedButton = button as? NSButton
+        
+        for button in self.tabButtons() {
+            button.state = (button === self.selectedButton!) ? NSOnState : NSOffState
+            button.highlighted = self.isHighlighted
+        }
+        
+        NSApplication.sharedApplication().sendAction(self.action, to: self.target, from: self)
+        NSNotificationCenter.defaultCenter().postNotificationName(TabsControlSelectionDidChangeNotification, object: self)
+        
+        if let currentEvent = NSApp.currentEvent {
+            if currentEvent.type == .LeftMouseDown && currentEvent.clickCount > 1 {
+                self.editTabButton(self.selectedButton!)
+            }
+            else if ...
+        }
     }
     
     public func selectedItemIndex() -> Int {

    }
    
    private func layoutTabButtons(buttons: Array<TabButton>?, animated anim: Bool) {
        
    }
    
    private func updateAuxiliaryButtons() {
        
    }

    // MARK: ScrollView Observation

    }
    
    // MARK: - Editing
    
    public func editTabButton(button: NSButton) {
        
    }
    
    // MARK: - Drawing
    
