• 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: Setting a clip mask on a NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting a clip mask on a NSView


  • Subject: Re: Setting a clip mask on a NSView
  • From: Jonathon Mah <email@hidden>
  • Date: Sun, 27 Jan 2008 11:59:34 +1030

Hi Tim,

On 2008-01-27, at 07:53, Timothy Wall wrote:

Is it possible to set an arbitrary clip mask on an NSView without rewriting its drawRect? The goal is to be able to clip/obscure parts of a NSView without necessarily putting anything in front of it.


You mention an "arbitrary" mask, but the next paragraph makes me think that a rectangular mask may be enough. If that's the case, you could stick your NSView inside an NSClipView, then set the clipping origin with -scrollToPoint: (it will take the size from the clip view).

Cocoa doesn't like the idea of "in front of" (overlapping views aren't supported, except in layer-backed Core Animation); the paradigm is more "inside of".

If you do need arbitrary clipping (circles or the like), you could implement your own clipview-like class, but you might not save much as you'd still have to call -drawRect: and pass it a rectangle (you could do some calculations and call it multiple times with multiple rects).



Jonathon Mah
email@hidden


_______________________________________________

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: Setting a clip mask on a NSView
      • From: Timothy Wall <email@hidden>
References: 
 >Setting a clip mask on a NSView (From: Timothy Wall <email@hidden>)

  • Prev by Date: how to programmatically popup NSComboBox menu?
  • Next by Date: reset NSServices values
  • Previous by thread: Setting a clip mask on a NSView
  • Next by thread: Re: Setting a clip mask on a NSView
  • Index(es):
    • Date
    • Thread