• 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: Custom NSView/NSWindow & First Responders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSView/NSWindow & First Responders


  • Subject: Re: Custom NSView/NSWindow & First Responders
  • From: Michael Ash <email@hidden>
  • Date: Thu, 11 Jun 2009 02:27:51 -0400

On Wed, Jun 10, 2009 at 9:34 PM, John Ku<email@hidden> wrote:
> Good afternoon all,
> Im having trouble setting the correct first responder / key window in my
> app.
>
> I have a subclass NSWindow with NSBorderlessWindowMask and a custom drawing
> NSView inside the window. So the window is transparent showing the NSView's
> drawing. The NSView image is drawn with NSDrawThreePartImage to create a
> resizable window.
>
> The problem is this: if i have an instance of NSTextField created within the
> NSView or NSWindow, the text field is selectable with mouse but does not
> accept keyboard events.
>
> I have my NSView set acceptsFirstResponder & becomeFirstResponder to return
> YES but still no dice.

By default, an NSWindow created with NSBorderlessWindowMask cannot
become the key window and thus cannot accept keyboard events. Subclass
NSWindow and override -canBecomeKeyWindow and it should work better
for you.

Mike
_______________________________________________

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

References: 
 >Custom NSView/NSWindow & First Responders (From: John Ku <email@hidden>)

  • Prev by Date: Re: Drop dowm status menubar item while hovering cursor over it
  • Next by Date: Re: App does not start on a different machine
  • Previous by thread: Custom NSView/NSWindow & First Responders
  • Next by thread: Re: Cocoa-dev Digest, Vol 6, Issue 855
  • Index(es):
    • Date
    • Thread