• 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
Searching for "frontmost" NSView of a certain type?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Searching for "frontmost" NSView of a certain type?


  • Subject: Searching for "frontmost" NSView of a certain type?
  • From: Dan Wood <email@hidden>
  • Date: Tue, 25 Jun 2002 16:00:00 -0700

I'm trying to come up with a general way to search for a
particular sub-view (e.g. any NSTableView) given a particular
enclosing view, such as a window's content view. The idea is
that I want to find the "frontmost" NSTableView in a given
window, meaning the first one it can find, subject to it being
actually visible (e.g. being contained in the active
NSTabViewItem in an NSTabView).

I think that this might be similar to -[NSview viewWithTag] but
I'm searching by a more arbitrary comparison, and I want to make
sure that the view is actually visible.

Does anybody have any code or algorithm (or method I'm missing)
for performing such? At this point, what I'm thinking of is a
recursive method that searches through a view's subviews, paying
special attention to NSTabView, traversing only into the current
item (and any others special subviews?)

But this seems really brute-force, so I'm up for more elegant
suggestions. Any takers?

Regards,
Dan Wood




--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Searching for "frontmost" NSView of a certain type?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: isFilePackageAtPath:@"/dev" error
  • Next by Date: Technical Support Incidents available
  • Previous by thread: Re: isFilePackageAtPath:@"/dev" error
  • Next by thread: Re: Searching for "frontmost" NSView of a certain type?
  • Index(es):
    • Date
    • Thread