Difference between revisions of "macOS extensions"

From Free Pascal wiki
Jump to navigationJump to search
Line 7: Line 7:
  
 
==Extensions==
 
==Extensions==
 +
After installation a new "macOS" tab is added to the components palette. All additional components are available in this tab:
 +
 +
[[Image:macosext mainbar.PNG]]
 
===TmacOSFormProp===
 
===TmacOSFormProp===
 
The component is introduced to control MacOS NSWindow specific attributes and features, not available via LCL API.
 
The component is introduced to control MacOS NSWindow specific attributes and features, not available via LCL API.

Revision as of 06:44, 15 April 2018

The package is intended to provide additional macOS Cocoa specific features.

Note: It's expected that those features will not work on any other system or as well as for deprecated Carbon API on macOS. However, it's expected that a project using the package would still succeffully compile and run on any other target.

Code

Extensions

After installation a new "macOS" tab is added to the components palette. All additional components are available in this tab:

macosext mainbar.PNG

TmacOSFormProp

The component is introduced to control MacOS NSWindow specific attributes and features, not available via LCL API.

Appearance

NSAppearance class was introduced in macOS 10.9 for the first time. It's per window appearance options. The fact that it's per window configuration makes it different from Themes - that's system wide configuration.

Appearance property of TmacOSFormProp component is used to adjust the appearance.

Apple suggests that there are 3 appearance styles currently available in the system:

* NSAppearanceNameAqua
* NSAppearanceNameVibrantDark
* NSAppearanceNameVibrantLight


The implementation is checking for the presence of NSAppearance class dynamically. Thus, if the code is launched on an earlier version of macOS, it would still be able to run, even though will not do anything.

See Also