Re: setEnabled equivalent for non-NSControl views
Re: setEnabled equivalent for non-NSControl views
- Subject: Re: setEnabled equivalent for non-NSControl views
- From: Keary Suska <email@hidden>
- Date: Thu, 19 Sep 2013 23:12:16 -0600
On Sep 19, 2013, at 9:10 PM, email@hidden wrote:
> I need to find a way to enable and disable views like NSScrollView and NSTextView in a manner similar to what happens when sending setEnabled: to views that inherit from NSControl
>
> That is, for such views to gray out and stop responding to mouse, key, scroll and gesture events.
> Kind of a modal state, if you will.
>
> So far it seems way more complicated than it should be which makes me believe I'm missing something obvious.
>
> Applying CIFilters and intercepting events seems like overkill.
>
> Anybody have suggestions on how best to achieve this?
Simply turn off editable and selectable for the NSTextView and disable the scrollers (they happen to be NSControls). The only tricky part is getting the greyed-out look--perhaps using layers.
Alternatively, you can take a snapshot of the NSScrollView (using NSBitmapImageRep or NSImage) and swap the actual view for a picture with an opacity mask that gives it a "disabled" appearance.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden