• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setEnabled equivalent for non-NSControl views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >setEnabled equivalent for non-NSControl views (From: email@hidden)

  • Prev by Date: Re: Still can't get autolayout to work the way I want
  • Next by Date: Re: iOS Calendar Question
  • Previous by thread: setEnabled equivalent for non-NSControl views
  • Next by thread: iOS 7 - Overriding NSNavigationController
  • Index(es):
    • Date
    • Thread