Question

I was wondering how to take care that my NSScrollView is not editable by the user, but i didn't find a way, there is no option in IB, nor do I find an appropriate method of the NSSCrollView class.

A previous post suggested to implement a delegate method

- (BOOL)textShouldBeginEditing:(NSText *)aTextObject

to return false, but this didn't work for me yet. No solution was given on the previous question.

(I also tried selecting the TextView everything it doesn't display an option 'editable' i just downloaded the new Xcode so the version shouldn't be a problem)

Was it helpful?

Solution

what is inside the scrollView that you want to prevent editing of?

what views have you got embedded in the scrollView? you need to find the view embedded in the scrollView that you want to prevent editing on, and call setEditable:NO on it.

OTHER TIPS

You can't make NSScrollView non-editable. You can hide scrollers with setHasVerical/HorizontalScroller: that would prevent user from scrolling.

If you have NSTextView and want to make it non-editable just send setEditable:NO to it, not the scroll view. For that you obviously need a reference to the NSTextView or use NSScrollViews -documentView.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top