For those without MBS here’s a plain version for DISABLING automatic tabbing in your app even if the user has set the Dock prefs to “Always”:
// Disable auto tabbing in Sierra
#if TargetCocoa
declare function NSClassFromString lib "Cocoa" (s as CFStringRef) as Ptr
declare function NSSelectorFromString lib "Cocoa" (s as CFStringRef) as Ptr
declare sub setAllowsAutomaticWindowTabbing lib "Cocoa" selector "setAllowsAutomaticWindowTabbing:" (cls as Ptr, ena as Boolean)
declare function respondsToSelector lib "Cocoa" selector "respondsToSelector:" (p as Ptr, sel as Ptr) as Boolean
dim nswCls as Ptr = NSClassFromString ("NSWindow")
if respondsToSelector (nswCls, NSSelectorFromString ("setAllowsAutomaticWindowTabbing:")) then
setAllowsAutomaticWindowTabbing (nswCls, false)
end
#endif
Also, be aware that if you have auto-adjusting controls, especially those locking to the button of the window, they may not correctly adjust if your window becomes tabbed. I consider this a bug in Xojo, see https://forum.xojo.com/35886