• 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: Are views active or inactive?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are views active or inactive?


  • Subject: Re: Are views active or inactive?
  • From: Rick Mann <email@hidden>
  • Date: Wed, 23 Dec 2009 11:20:40 -0800

On Dec 23, 2009, at 03:06:58, Gregory Weston wrote:

> Did you happen to have an 'a-ha' moment when you typed that sentence? "Views" don't generally have an active/inactive state. Controls, which are a special case of view, do. So have you considered making your custom view an NSControl instead of a simple NSView?
>
> That's the thing, you see. "Inactive" means the user can't interact with it. But the user can't interact with a view that's not a control anyway, so the state has no meaning.

On the contrary, users can interact with an inactive control. They can't interact with a disabled control. Consider a scroll bar. It can draw in an inactive state (not blue), but you can still interact with it by sending the window scroll events (something I'm unconvinced you should be able to do, but you can, and it proves convenient).

In my case, it's a drawing canvas. However, the active drawing tool should not draw when the view is inactive (not frontmost). Since the tool is a singleton object in the app used by many views, it's important to be able to make the distinction. I suppose I could subclass NSControl, but this strikes me as inelegant (and I don't know that it has active/inactive state anyway).

--
Rick

_______________________________________________

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

  • Follow-Ups:
    • Re: Are views active or inactive?
      • From: Gregory Weston <email@hidden>
References: 
 >Re: Are views active or inactive? (From: Gregory Weston <email@hidden>)

  • Prev by Date: Re: NSRecursiveLock problems
  • Next by Date: Re: Are views active or inactive?
  • Previous by thread: Re: Are views active or inactive?
  • Next by thread: Re: Are views active or inactive?
  • Index(es):
    • Date
    • Thread