• 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: How to find all clipping siblings for a view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find all clipping siblings for a view?


  • Subject: Re: How to find all clipping siblings for a view?
  • From: "Norbert M. Doerner" <email@hidden>
  • Date: Fri, 16 Apr 2010 10:40:38 +0200


For some reason I need to do a job which NSWindow usually does, when it redraws itself (AFAIU) - I need to find all its views, which have z-
order higher than my view, then get their bounding rectangles, unite them, subtract from the window content view bounding rectangle and sect the result with my view bounding rectangle. This is because my view uses QuickDraw to redraw itself, but those functions draw on screen directly (AFAIU) and don't take into account other views, located above current view.


Could anybody show the right way to go?

NSView *rootView; NSArray *mySubViews rootView = [theWindow contentView]; mySubViews = [rootView subviews];

mySubViews is any NSArray of NSViews. Go through them, and get the frame for each of them, then do your math.
For certain view types, you may need to consider their subviews as well, such as NSTabView, which has its own mySubViews = [aTabView tabViewItems];


Alternatively, consider drawing your stuff into an NSImage and use an image view to let Cocoa do all the magic for you...

Yours,
--
Norbert M. Doerner
CEO, West-Forest-Systems
In der Trift 13
56459 Langenhahn, Germany
Fon: +49 (2663) 91 70 128 (Central European Time Zone...)
Fax: +49 (2663) 91 70 126
AIM (iChat), Skype: cdfinderceo
Twitter: http://www.twitter.com/cdfinder
---------------------------------------------------------------------------------------------------
CDFinder - The Search Is Over! http://www.cdfinder.de/
Catalog and organize your photos, songs, videos, disks, data, anything...
NEW: CDFinder 5.7 - Better Cataloging than ever - and Geotagging.
Also catalogs MS Word, Quark XPress, Adobe InDesign Illustrator. And more!
---------------------------------------------------------------------------------------------------
_______________________________________________


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: How to find all clipping siblings for a view?
      • From: "Alexander Bokovikov" <email@hidden>
  • Prev by Date: Re: How to empty the Trash programmatically?
  • Next by Date: Re: How to empty the Trash programmatically?
  • Previous by thread: How to find all clipping siblings for a view?
  • Next by thread: Re: How to find all clipping siblings for a view?
  • Index(es):
    • Date
    • Thread