Tools
Items
- ezui.makeItem(description, container=None, controller=None, descriptionData={})
Make an item from a description dictionary or a text shortcut.
The dictionary must have a
"type"
key that defines the class to use.All other key/value pairs will be used to make the item.
Colors
- ezui.makeColor(color)
Create a color object for use with AppKit.
color
may be three types:A tuple of
(red, green, blue, alpha)
with the component values being between0
and1
.A string naming a known color. The options are below.
A NSColor. This is a convenience so that color type testing doesn’t have to be done elsewhere.
Named Colors:
"black"
"white"
"clear"
"blue"
"brown"
"gray"
"green"
"indigo"
"orange"
"pink"
"purple"
"red"
"teal"
"yellow"
"label"
"secondaryLabel"
"tertiaryLabel"
"quaternaryLabel"
"text"
"textBackground"
"selectedText"
"selectedTextBackground"
"windowBackground"
Custom colors may be registered with
registerColor()
.
- ezui.registerColor(name, color)
Register a color. Names must be unique. It is recommended that custom colors be registered with names following the reverse domain naming structure.
Images
- ezui.makeImage(imagePath=None, imageName=None, symbolName=None, symbolConfiguration=None, accessibilityDescription=None, variableValue=None, template=False)
If
symbolName
and either ofimageName
andimagePath
are given,symbolName
will be used when symbols are available. This allows the image to be a fallback for when the OS version does not support SF Symbols.
- ezui.makeSymbolConfiguration(style=None, pointSize=None, weight=None, scale=None, renderingMode=None, colors=None)
Fonts
- ezui.makeFont(systemStyle=None, name=None, size=None, sizeStyle='regular', weight=None, designStyle=None)
systemStyle
One of the system defined styles."largeTitle"
"title1"
"title2"
"title3"
"headline"
"subheadline"
"body"
(default)"callout"
"footnote"
"caption1"
"caption2"
weight
One of the system defined weight styles, only avaible whenname
is set to"system"
or"system-monospaced"
;"ultraLight"
"thin"
"light"
"regular"
"medium"
"semibold"
"bold"
"heavy"
"black"
designStyle
One fo the system defined desing styles, only avaible whenname
is set to"system"
or"system-bold"
;"default"
"monospaced"
"rounded"
"serif"
Metrics
- ezui.metrics()
Common values.
"windowMarginH"
Horizontal spacing between the frame of a window and inset items."windowMarginV"
Vertical spacing between the frame of a window and inset items."windowMarginLeft"
Spacing between the left of the window and inset items."windowMarginRight"
Spacing between the right of the window and inset items."windowMarginTop"
Spacing between the left of the window and inset items."windowMarginBottom"
Spacing between the bottom of the window and inset items."boxContentMarginH"
Horizontal spacing between the frame of boxes and inset items."boxContentMarginV"
Vertical spacing between the frame of boxes and inset items."tabContentMarginH"
Horizontal spacing between the frame of tabs and inset items."tabContentMarginV"
Vertical spacing between the frame of tabs and inset items."tabContentMarginLeft"
Spacing between the left of tabs and inset items."tabContentMarginRight"
Spacing between the right of tabs and inset items."tabContentMarginTop"
Spacing between the left of tabs and inset items."tabContentMarginBottom"
Spacing between the bottom of tabs and inset items."itemSpacingH"
Horizontal spacing between items."itemSpacingV"
Vertical spacing between items.
Classes
- ezui.registerClass(name, cls)
Register a class.
name
must be a unique string that names your class. This is the name that will be used in the EZML with the* ItemType
reference sytax.cls
must be a class conforming to the ezui protocol.
- ezui.knownItemTypes()
Get a list of all available item types.