1 Reply
      Latest reply on Jul 15, 2019 2:46 PM by Macho Man Randy Savage
      Lucky7 Level 1 Level 1 (0 points)

        Some apps like VMWare Fusion, are able to enable tab mode but hide the New Tab button. However, I'm not able to achieve this even when adding this code like mentionned on https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/:

         

        override func responds(to aSelector: Selector!) -> Bool {
                if #available(OSX 10.12, *) {
                    if aSelector == #selector(NSResponder.newWindowForTab(_:)) {
                        return false
                    }
                }
                return super.responds(to: aSelector)
            }
        

         

        • Re: Hide New Tab Button
          Macho Man Randy Savage Level 3 Level 3 (365 points)

          This works for me in a NSDocumentController subclass:

           

          -(BOOL)respondsToSelector:(SEL)aSelector
          {
              if ([NSStringFromSelector(aSelector) isEqualToString:NSStringFromSelector(@selector(newWindowForTab:))])
              {
                  return NO;
              }
              else
              {
                  return [super respondsToSelector:aSelector];
              }
          }
          

           

          Why  there isn't simply a showsAddNewTabButton property on NSWindowTabGroup is a mystery.