I actually pulled the code from your KitchenSink project and copy and pasted the structure so the alignment attribute came with it…
The above was on my machine at work…
On my Mac at home which is also running 12.6.8, I get the same thing as at work.
10.16.0
If it matters, both are Intel Macs.
The only reason I care about OS version right now, is that I need to use a declare that is only available in MacOS 12 and above that Greg provided on TOF in an app I’m working on, and want to avoid problems on older OS versions.
Big Sur on intel reports 10.16
Big Sur on arm reports 11
I hadn’t heard about that seeping into anything newer.
If I remember correctly, you can determine if a declare will work with declares rather than checking the os version. I don’t recall the specific function at the moment though.
By hacking the SDK version of the executable. Apps which are not built against macOS 11 (edit: or newer), see 10.16.
This is done for good reason as some things do NOT behave the same with older SDKs.
p.s. App Wrapper will allow you to hack the SDK version, I wrote that in so I could use some of the newer Big Sur features before Xojo even dreamed of it, and then forgot about it renaming all the things.
Below is some code where I set booleans allowing me to pick and choose colors and things. This kind of action is NOT recommended by Apple btw, they instead recommend checking for classes and methods.
Dim currentOS as NSOperatingSystemVersion = NSProcessInfo_operatingSystemVersion( NSProcessInfo_processInfo( NSProcessInfoClass ) )
Dim cOS as integer = cdbl( right( "00" + str( currentOS.major ), 2 ) + right( "00" + str( currentOS.minor ), 2 ) + _
right( "00" + str( currentOS.bug ), 2 ) )
operatingSystemisAtLeastVentura = cOS >= 130000
operatingSystemisAtLeastBigSur = cOS >= 101600
operatingSystemisAtLeastMojave = cOS >= 101400
Below is an example of how Apple recommends things to be handled. This code asks the OS for the presence of the “effectiveAppearance” method and sets a global property to use that method, otherwise fall back to the pre 10.14 version.
This particular function is used to determine if a control/view has a dark appearance or not.
// --- We test the global shared application instance.
if NSObject_respondsToSelector( NSApplication_sharedApplication, NSSelectorFromString( "effectiveAppearance" ) ) then
appearanceFunctionSelector = NSSelectorFromString( "effectiveAppearance" )
else
appearanceFunctionSelector = NSSelectorFromString( "appearance" )
end if
FWIW, respondsToSelector was the function I couldn’t recall. I too would recommend you go down that route. You can probably find examples by searching TOF.