Ask Your Question
1

How can I programmatically ensure that the window tabbar is always displayed in macOS Swift?

asked 2021-12-10 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-26 14:00:00 +0000

ladyg gravatar image

You can use the tabbingMode property of the NSWindow class to ensure that the window tabbar is always displayed in macOS Swift.

Here is an example code snippet that sets the tabbingMode property of a window to preferred:

let window = NSApplication.shared.windows.first! window.tabbingMode = .preferred 

This will make the window tabbar always visible, even if there is only one tab in the window. If you set the tabbingMode property to automatic, the tabbar will only be visible if there are multiple tabs in the window.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-10 11:00:00 +0000

Seen: 10 times

Last updated: Jun 26 '21