             createDrawScene()
         }
         
-        clearButton.isEnabled = DatasourceController.shared.currentMode == .text || DatasourceController.shared.currentMode == .sketch
+        clearButton.isEnabled = mode == .text || mode == .sketch
     }
     
     var rawText: String = ""

    }
    
    @IBAction func pageTouchBarDidChange(_ sender: NSSegmentedControl) {
        DatasourceController.shared.save()
        DatasourceController.shared.currentViewIndex = sender.selectedSegment + 1
        DatasourceController.shared.load()
        
        setupViewButtons()
    }
    
    func createDrawScene() {

        }
    }
    
    func changeView(viewIndex: Int) {
        DatasourceController.shared.saveText()
        DatasourceController.shared.currentViewIndex = viewIndex
        DatasourceController.shared.loadNote()
    }
    
    @IBAction func changeView(_ sender: NSButton) {
        changeView(viewIndex: sender.tag)
    }

    @IBAction func viewDidChange(_ sender: NSPopUpButton) {
