[futurebasic] Re: [FB] Upgrading to Yosemite

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2014 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 21 Oct 2014 00:52:03 -0400
In addition to Brian's good suggestions, here's another approach:

include "ConsoleWindow"
compile as "Objective-C"

BeginCDeclaration
CFStringRef osVersion();
EndC

BeginCFunction
CFStringRef osVersion() {
NSDictionary *version = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
return (CFStringRef)[version objectForKey:@"ProductVersion"];
}
EndC
toolbox fn osVersion = CFStringRef

dim as CFStringRef versionStr

versionStr = fn osVersion

fn HIViewSetText( sConsoleHITextView, versionStr )

CFRelease(versionStr)