- I tried setting
controlSize, and it didn't work. - I tried setting
NSMenuItem.attributedTitle, and it didn't work. SettingNSMenuItem.attributedTitlemade text smaller, but didn't make checkmarks smaller. Therefore result looks broken.
Here's code to reproduce.
let testFont1 = NSFont.menuFont(ofSize: NSFont.systemFontSize(for: .mini))
let menu1 = NSMenu()
menu1.font = testFont1
menu1.addItem(withTitle: "AAA", action: nil, keyEquivalent: "")
let item2 = NSMenuItem()
item2.attributedTitle = NSAttributedString(string: "BBB", attributes: [.font: testFont1])
menu1.addItem(item2)
let popup1 = NSPopUpButton()
popup1.menu = menu1
popup1.controlSize = .mini
popup1.sizeToFit()
window.contentView?.addSubview(popup1)
How to make a mini-sized pop-up button properly with no NIB and only code?

Just assign mini-size font to the
NSPopUpButtoninstance.Nothing else is really required. The code can be shorten like this.
This applies equally to any other control-based classes. You need to set both
controlSizeandfont. It seemscontrolSizecontrols only graphical appearance part andfontcontrols text renderings.