I can't use custom touchpad in macOS status window

I have an application that displays as a status bar application (in Info.plist "Application is an agent (UIElement) = YES").

I added a TouchBar with the Builder interface, and I added some elements of the Touch Bar buttons to it. The problem is that the user touchpad is not displayed.

To make a custom touchpad to show, I need to make the main WindowController window as Is Initial Controller true, unfortunately, having done this, the application also visits a separate window with the same contents as the popup window of the menu item.

Is there a way to implement a custom touchpad for a MacOS application in the status bar?

enter image description here

+8
macos-sierra menu nstouchbar
source share
1 answer

Have you tried to assign a touchBar to your NSApplication? You must have the IBOutlet assigned by your IB touchBar, and assign it at run time.

@property (weak) IBOutlet NSTouchBar *testTouchBar; [...] [NSApplication sharedApplication].touchBar = _testTouchBar; 
0
source share

All Articles