{"id":325,"date":"2019-10-01T11:03:10","date_gmt":"2019-10-01T17:03:10","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=325"},"modified":"2019-11-19T09:52:24","modified_gmt":"2019-11-19T16:52:24","slug":"opting-in-or-out-of-windows-autotabbing","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2019\/10\/01\/opting-in-or-out-of-windows-autotabbing\/","title":{"rendered":"Opting in or out of Windows AutoTabbing"},"content":{"rendered":"\n<p>macOS adopted an interesting behaviour some time ago where when you opened a new window in an application. It would default to opening a new tab in the window instead of opening a new window.<\/p>\n\n\n\n<p>If your application could not deal with this and the user had the preference in System Preferences &gt; Dock &gt; Prefer Tabs when opening documents set to <em>Always<\/em> then it could cause your app issues.<\/p>\n\n\n\n<p>You can opt out of this behaviour in your app&#8217;s open event.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Public Sub AppAutoTabbing(optIn as boolean)\n  #if not TargetMacOS\n    #pragma unused optIn\n  #endif\n  \n  #if TargetMacOS\n    \n    Declare Function NSClassFromString Lib \"Cocoa\" (name As CFStringRef) As Ptr\nDim nsWindowClass As ptr = NSClassFromString( \"NSWindow\" ) \n\nif nsWindowClass = nil then\n  \/\/ msgbox CurrentMethodName + \" nsWindowClass is Nil\"\n  break\n  return\nend if\n\ndeclare sub EnableTabGrouping lib \"AppKit\"selector \"setAllowsAutomaticWindowTabbing:\" ( classPtr as Ptr , enableDisable as Boolean ) \n\nEnableTabGrouping( nsWindowClass, optIn )\n    \n  #endif\n  \nEnd Sub\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>macOS adopted an interesting behaviour some time ago where when you opened a new window in an application. It would default to opening a new tab in the window instead of opening a new window. If your application could not deal with this and the user had the preference in System Preferences &gt; Dock &gt; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2019\/10\/01\/opting-in-or-out-of-windows-autotabbing\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Opting in or out of Windows AutoTabbing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[4,6,3],"class_list":["post-325","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-macos","tag-tips","tag-xojo"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":2,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/325\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}