• 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
Preventing window selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preventing window selection


  • Subject: Preventing window selection
  • From: Ricky Sharp <email@hidden>
  • Date: Wed, 14 Jul 2004 18:15:12 -0500

I'm making great progress in moving my Carbon app to Cocoa; just a few minor stumbling blocks here and there.

One such item is I'd like to know the best method for preventing windows from being selected. Basically, I have full-screen "blanking" windows on all displays. I then have a content window that is centered on the user's selected display. Clicks on blanking windows should not bring them forward.

In the Carbon version, I originally tried putting the content window in the floating layer (level), but this proved to be very problematic. The solution was to attach an event handler to my blanking windows and listen for mouseDown events. When the handler received such an event, it would return noErr which effectively "ate" the event and didn't allow it to be handled by the standard window handler.

In the Cocoa version, I have a derived NSWindow class to manage my blanking windows. I provided overrides to canBecomeKeyWindow: and canBecomeMainWindow: (both return NO), but they still allow the window to be selected and moved to the front. To get past this hurdle for now, I simply put the content window in the floating window layer.

Are there any penalties to pay in Cocoa if my content window is floating? Or, would the "eat mouse event" solution be the best? If so, what's the proper method in doing so?

Thanks,
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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: Preventing window selection
      • From: Glenn Andreas <email@hidden>
  • Prev by Date: Re: scrolling an NstextView
  • Next by Date: Dumping input to NSTask
  • Previous by thread: Re: scrolling an NstextView
  • Next by thread: Re: Preventing window selection
  • Index(es):
    • Date
    • Thread