Home > database >  NSWindow tab bar is hidden even with multiple windows in the tab group
NSWindow tab bar is hidden even with multiple windows in the tab group

Time:03-02

I'm trying to add tabs to an old codebase, and followed along the documentation. But the tab bar remains hidden, even with multiple windows in the tab group: The menu Window > Show Previous Tab and Window > Show Next Tab work as expected.

With a breakpoint after:

self.window?.addTabbedWindow(newWindow, ordered: .above)
newWindow.orderFront(self.window)
newWindow.makeKey()

The tab bar is visible, until I continue the breakpoint.

Inspecting the NSWindow.tabGroup.tabBarVisible before and later also has the tab bar set as visible.

CodePudding user response:

Turns out the tab bar is implemented as a NSTitlebarAccessoryViewController and is part of the NSWindows.titlebarAccessoryViewControllers.

The problem was we also used a NSTitlebarAccessoryViewController in our app, and removed it by iterating all NSWindows.titlebarAccessoryViewControllers and removing each one.

  • Related