pierocampanelli
pierocampanelli

Reputation: 948

NSTextField inside NSStatusBar: focus and editable problems

My Cocoa App is made by a NSStatusBar with a NSTextField inside and a Main Window.
Please, look the screenshots to get the idea:

enter image description here

I have two problems:

  1. When I open Menubar I am unable to got the focus to SearchField (like Spotlight) and I am unable to select content with something like [textField selectText:self]

  2. Worsts: if my MainWindow is on front it works without problems. If my MainWindow is not on front but is visible I am unable to edit TextField. It is selectable with mouse but not editable. Why this ?

enter image description here

I tried all the hacks found but I was unable to solve the issue.

Upvotes: 5

Views: 753

Answers (1)

Joshua
Joshua

Reputation: 15510

I have also had this problem so I ended up completely recreating NSMenu using a NSWindow. I named it JGMenuWindow and you can find the open source code on GitHub here.

Here's an example of what it can do:

enter image description here

Upvotes: 6

Related Questions