Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable user interaction in a custom View

I have a custom View NSView and I want to disable userinteraction, but I'm not sure how to do this.

My idea was:

[myView setEnabled:NO];

but it's wrong and doesn't work. How can I make it so that, it's just visible for the user, and nothing else?

like image 366
Viper OS X Avatar asked Jul 31 '12 12:07

Viper OS X


1 Answers

NSView doesn't have either setEnabled: or setIgnoresMouseEvents:

Implement the hitTest: method to return nil.

like image 187
Ravindhiran Avatar answered Oct 25 '22 01:10

Ravindhiran