• 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: Preventing mouse clicks from bringing a window to the front
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing mouse clicks from bringing a window to the front


  • Subject: Re: Preventing mouse clicks from bringing a window to the front
  • From: Evan Schoenberg <email@hidden>
  • Date: Fri, 18 Feb 2005 16:47:27 -0600

I'd use -[NSWindow setLevel:] in combination with preventing key and main states. See the docs[1] for details.

-Evan

[1] file:///Developer/ADC Reference Library/documentation/Cocoa/ Reference/ApplicationKit/ObjC_classic/Classes/NSWindow.html

On Feb 18, 2005, at 10:08 AM, Gregg Witmer wrote:

Here is an over simplified description of my problem...

My app has one window open and another window open behind it -- I would like to prevent the user from bringing the back window up to the front.

How can I override the action of a user clicking on the back window to prevent that window from moving to the front.

The closest I can get to this behavior is to send -setIgnoresMouseEvents to the back window but that simply makes the window transparent and will act as if the click was on whatever was behind this window -- in most cases the Finder.

Preventing key and main states do just that and the window will still move to the front.

I have tried overriding sendEvent in subclasses of NSWindow, NSWindowController, NSApplication and NSView with no success. The window seems to get moved to the front before any of these objects receive the sendEvent or mouseDown messages.

shouldDelayWindowOrderingForEvent gives mixed results and has no effect if the click is on the title bar.

I really prefer not to use sheets and in some cases sheets just are not an option.

Does anyone out there have a clue on this one?

Thanks.

Gregg
_______________________________________________
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


_______________________________________________ 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
References: 
 >Preventing mouse clicks from bringing a window to the front (From: Gregg Witmer <email@hidden>)

  • Prev by Date: NSApplication Bug or Feature: Keystroking -performClose closes all windows?
  • Next by Date: Re: System Provided Font Menu?
  • Previous by thread: Preventing mouse clicks from bringing a window to the front
  • Next by thread: Re: Preventing mouse clicks from bringing a window to the front
  • Index(es):
    • Date
    • Thread