NSTextField inside NSStatusBar: focus and editable problems

My Cocoa Application is created using NSStatusBar with NSTextField inside and in the main window.
Please see the screenshots to understand:

enter image description here

I have two problems:

  • When I open Menubar, I canโ€™t focus on SearchField (like Spotlight) and I canโ€™t select content with something like [textField selectText: self]

  • Worst: if my MainWindow is at the front, it works without a problem. If my MainWindow is not on the front, but visible , I cannot edit the TextField . It can be selected with the mouse, but cannot be edited. Why is this?

enter image description here

I tried all the hacks found, but I could not solve the problem.

+4
source share
1 answer

I also had this problem, so I completely recreated NSMenu using NSWindow . I called it JGMenuWindow , and you can find open source on GitHub here .

Here is an example of what he can do:

enter image description here

+6
source

All Articles