• 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
Status Bar Search Field Can't Get Focus w/ LSUIElement PList Setting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Status Bar Search Field Can't Get Focus w/ LSUIElement PList Setting


  • Subject: Status Bar Search Field Can't Get Focus w/ LSUIElement PList Setting
  • From: Dalmazio Brisinda <email@hidden>
  • Date: Thu, 15 Oct 2009 17:19:18 -0600

I'm having a problem getting a NSSearchField to work properly in an NSStatusItem a la the Apple Help menu or the Apple Spotlight menu.

Here's what's happening.

I create my custom NSStatusItem / menu / custom view/ search field, and insert into into the status bar in -awakeFromNib. Setting the LSUIElement property in the Info.plist file then results in everything displaying and working correctly the very first time the NSStatusItem is clicked (after running the application from Xcode and it becomes "active"). The associated menu pops up with the custom view and search field, the search field has focus, shows the insertion pointer, and I can type a search term, press enter, and everything works great. But if I select the NSStatusItem a second time to perform a second search there is no insertion pointer, and I can't select the search field. When I try clicking around the custom view several times I get the following error:

HIViewSetFocus() failed with error -30599

Now, if I don't set the LSUIElement property in the Info.plist file, and just run the application as a normal application, then I can get around the above problem by selecting the application first (making it active) and then the search field in the menu associated with the NSStatusItem always gets focus, the insertion pointer appears, and everything works fine. But I want to build an application that doesn't have a doc icon, window, or main menu using the LSUIElement property setting.

From what I understand, it seems that the application needs to be "active" in order for the search field to get focus and for the text insertion pointer to appear, but I don't understand how to "force" this for an application that doesn't have a main window, doc icon, or menu bar by enabling LSUElement.

Can anyone help?

Best,
Dalmazio

_______________________________________________

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


  • Follow-Ups:
    • Re: Status Bar Search Field Can't Get Focus w/ LSUIElement PList Setting
      • From: Dalmazio Brisinda <email@hidden>
  • Prev by Date: Re: GC crash due to being naughty
  • Next by Date: Re: Subclassing a view class from an external framework
  • Previous by thread: Re: GC crash due to being naughty
  • Next by thread: Re: Status Bar Search Field Can't Get Focus w/ LSUIElement PList Setting
  • Index(es):
    • Date
    • Thread