mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-09 00:59:59 +00:00
20 lines
467 B
Swift
20 lines
467 B
Swift
import Cocoa
|
|
|
|
func makeLabel(_ text: String,
|
|
size: CGFloat = 0,
|
|
color: NSColor = NSColor.textColor) -> NSTextField {
|
|
|
|
let textField = NSTextField()
|
|
textField.stringValue = text
|
|
textField.backgroundColor = .clear
|
|
textField.isEditable = false
|
|
textField.isBezeled = false
|
|
textField.sizeToFit()
|
|
|
|
// Text
|
|
textField.font = NSFont.systemFont(ofSize: size)
|
|
textField.textColor = color
|
|
|
|
return textField
|
|
}
|