2

I want to add the tabbing mechanism that you can see e.g. in Safari, the Console or the Finder (http://dailymactips.com/working-with-finder-tabs-on-your-mac/). I have already searched a lot, but I can not find a good guide for this.

Ideally, I want to be able to push an alert-dialog before a new tab is created by the user.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Tterhuelle
  • 103
  • 9

1 Answers1

4

NSWindow has native tabs for a couple of years now.

The "Whats new in Cocoa" session from WWDC 2016 is the best place to start, since the documentation is quite thin still.

Whats New In Cocoa (203 WWDC 2016)

If you are using (for example) the method addTabbedWindow::ordered:, you can simply show your alert before adding the tab.

TheNextman
  • 12,428
  • 2
  • 36
  • 75
  • do you also know how i can get the tab bar showing when i have only one tab? – Tterhuelle Feb 19 '18 at 07:27
  • Not sure; but did you try calling toggleTabBar: (https://developer.apple.com/documentation/appkit/nswindow/1644517-toggletabbar)? – TheNextman Feb 19 '18 at 15:30
  • NSWindows tab feature is covered briefly in WWDC 2017, not 2016: https://developer.apple.com/videos/all-videos/?q=what%27s%20new%20in%20cocoa –  Aug 04 '21 at 07:03