You probably dont need to create a custom view or mess with the frame. Have a poke around with the imagePosition: NSControl.ImagePosition property and maybe the buttonType also.
Also remember that the tutorial sets the item length as .square . Maybe see how using .variableLength affects things.
Unfortunately, imagePosition only affects the alignment of the image with respect to the text. Without an image, the text is supposed to be centered (of course I tried all the possibilities). Also changing the button type did not solve the issue, although the text position seems to be OK when using NSRadioButton (but that’s not what I need).
The items in the menu bar (and the clock as well) are well aligned, but I can’t find what class that is (NSMenuItem?). Would it be possible to use one of those somehow in the statusItem?
I am unable to use .squareLength and .variableLength since I am on 10.11.6 and Xcode 8.2.1. I also had to use .system() instead of .system as you also explained in an earlier comment.
Anyway, thanks for the kind support! I will keep fiddling around with things while I’m learning.