Q: How do I disable and enable an NSTextView?
A: Currently there is no direct way to disable and re-enable an NSTextView. However, with a few lines of code you can implement this feature on your own. The sample code below best illustrates this by changing the selectable and editable attributes as well as its text color.
Listing 1: Disabling and Enabling NSTextView
[textView setSelectable: enableIt];
[textView setEditable: enableIt];
[textView setTextColor: [NSColor controlTextColor]];
[textView setTextColor: [NSColor disabledControlTextColor]];
Document Revision History