NSSquareStatusItemLength
NSSquareStatusItemLength is a predefined constant used in macOS development with the AppKit framework. It is passed as the length parameter when creating a status item via NSStatusBar, and it requests a square item whose width equals the height of the menu bar. This ensures the status item has a square footprint regardless of its content.
In practice, NSSquareStatusItemLength tells the system to size the item to the standard height of the status
- Objective-C: NSStatusItem *item = [statusBar statusItemWithLength:NSSquareStatusItemLength];
- Swift: let statusItem = NSStatusBar.system.statusItem(withLength: NSSquareStatusItemLength)
When using NSSquareStatusItemLength, it is common to configure the status item with a button or a custom
Related constants include NSVariableStatusItemLength, which indicates a flexible length, and NSStatusItemLength, which is the general type