Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

KnownTimeZoneNamesAsCFArrayMBS as CFArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method CoreFoundation MBS MacCF Plugin 3.2 Yes No No Yes, macOS only No
Function: An array of all known time zone names.
Notes: Returns nil on any error.

Feedback, Comments & Corrections

MacShowAboutBoxMBS(options as CFDictionaryMBS) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method CoreFoundation MBS MacCF Plugin 9.3 Yes No No Yes, macOS only No
Function: Displays an HI-conformant about box.
Example:
dim kHIAboutBoxNameKey as CFStringMBS = NewCFStringMBS("HIAboutBoxName")
dim kHIAboutBoxVersionKey as CFStringMBS = NewCFStringMBS("HIAboutBoxVersion")
dim kHIAboutBoxCopyrightKey as CFStringMBS = NewCFStringMBS("HIAboutBoxCopyright")
dim kHIAboutBoxDescriptionKey as CFStringMBS = NewCFStringMBS("HIAboutBoxDescription")
dim kHIAboutBoxStringFileKey as CFStringMBS = NewCFStringMBS("HIAboutBoxStringFile")

dim d as CFMutableDictionaryMBS

d=NewCFMutableDictionaryMBS

// name, version and copyright are optional:
d.add(kHIAboutBoxNameKey, NewCFStringMBS("MyApp"))
d.add(kHIAboutBoxVersionKey, NewCFStringMBS("1.0"))
d.add(kHIAboutBoxCopyrightKey, NewCFStringMBS("© 2009 by Christian Schmitz"))

// description is needed
d.add(kHIAboutBoxDescriptionKey, NewCFStringMBS("The best application I ever made!"))

// optional
'd.add(kHIAboutBoxStringFileKey, NewCFStringMBS("somefile"))

MsgBox Str(MacShowAboutBoxMBS(d))
Notes:
This about box is a generic about box that automatically can display your application name, version string, and copyright string. It peeks into either the Info.plist (for the CFBundleName, CFBundleVersion, and CFBundleGetInfoString keys) or your bundle resource (not recommended) to get the information by default. You can customize what it displays by passing in various options in the input dictionary. Note that currently the description string can only be specified in the options dictionary; this function does not check your Info.plist for a descriptions string.

There are three basic ways to call this function. First, you can pass nil for inOptions. As mentioned, default information will be displayed. Second, you can pass the actual values for the strings displayed by passing the strings in the inOptions dictionary using the keys provided, such as kHIAboutBoxNameKey. If a replacement string is not passed, the default behavior kicks in. For example, you could pass some variant of your application name in the dictionary, but not pass a replacement version or copyright strings. The Toolbox would display your replacement string, and fall back to looking in the Info.plist for the other strings. The third way to call this is to pass the name of a string file in the dictionary with the key kHIAboutBoxStringFileKey. We will automatically use that file to find the strings for the about box. The keys in the string file should be the same value as the keys you would use to pass into the inOptions dictionary. Again, if a string is not found in that file, we would fall back to looking for a string in the dictionary, and then finally the Info.plist. Certainly this is not the be-all-end-all of about boxes, but it does provide a simple no-work about box for your application. The standard Toolbox application handler now responds to the kHICommandAbout command ID by calling HIAboutBox for you. This means that any Carbon Event-based application will get this behavior for free right out of the box. If you wish for the window to respond to cmd-W in the menu bar, you should make sure that menu item has the kHICommandClose commandID.

Options: A dictionary of replacement strings, or the name of a string file to retrieve the strings from, or nil. See the discussion for how this is used.

Returns a Mac OS error code or -1 if function is not available.
Not supported on 64 bit targets.

Feedback, Comments & Corrections

SetDefaultCFTimeZoneMBS(timezone as CFTimeZoneMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method CoreFoundation MBS MacCF Plugin 3.2 Yes No No Yes, macOS only No
Function: The default time zone.
Example:
msgBox str(GetDefaultCFTimeZoneMBS.SecondsFromGMT(nil).Value)
Notes: Returns nil on any error.

Feedback, Comments & Corrections

SystemCFTimeZoneMBS as CFTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method CoreFoundation MBS MacCF Plugin 3.2 Yes No No Yes, macOS only No
Function: The current system time zone.
Example:
dim s as CFTimeZoneMBS
s=SystemCFTimeZoneMBS
MsgBox s.Name.str
Notes: Returns nil on any error.

Some FAQ entries about this method:

Feedback, Comments & Corrections

TypeIDDescriptionMBS(TypeID as Integer) as CFStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method CoreFoundation MBS MacCF Plugin Yes No No Yes, macOS only No
Function: Returns a string with the name for the CoreFoundation data type.
Notes: e.g. "CFStringMBS" for a CFStringMBS.

Feedback, Comments & Corrections

Previous items

The items on this page are in the following plugins: MBS MacCF Plugin.




Links
MBS Xojo blog