• 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: if an NSWindow is a drawer, how can I find the NSDrawer instance?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?


  • Subject: Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
  • From: Andy Lee <email@hidden>
  • Date: Sat, 21 May 2005 10:03:50 -0400

On May 20, 2005, at 3:08 PM, Mike Morton wrote:
I have an NSWindow which is showing the contents of a drawer, and I want to find the NSDrawer instance for it. How can I do this? (I don't want to check for undocumented classes like NSDrawerWindow.)


I thought I'd be able to do it by asking for the window's parentWindow, asking the parent window for drawers, then walking the drawers to find one with a content view whose window is the window I started with.

How about if you start the search one level higher -- walk NSApp's -windows to find the one whose -drawers include one whose display window (i.e., its -contentView's window) is the window you started with? It means traversing a larger data structure, but maybe not prohibitively large?


P.S. Why do I want to do all this? Running a modal sheet blocks clicks in the sheet's window, but in not a sheet's window's drawer. So I thought I'd override NSWindow's sendEvent: to check whether a click is in a drawer whose parent is a sheet...

I was going to suggest sending -setIgnoresMouseEvents: messages to the drawer's display windows before and after opening the sheet. But from the docs, it sounds like this would cause clicks to pass *through* the drawer to whatever's under it? But maybe you could write a variation called -setDiscardsMouseEvents: that would work in conjunction with an override of -sendEvent:.


--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
      • From: Mike Morton <email@hidden>
References: 
 >if an NSWindow is a drawer, how can I find the NSDrawer instance? (From: Mike Morton <email@hidden>)

  • Prev by Date: Serious bug in NSFileManager fileExistsAtPath:?
  • Next by Date: Re: Serious bug in NSFileManager fileExistsAtPath:?
  • Previous by thread: if an NSWindow is a drawer, how can I find the NSDrawer instance?
  • Next by thread: Re: if an NSWindow is a drawer, how can I find the NSDrawer instance?
  • Index(es):
    • Date
    • Thread