How to make NSButton of NSAlert crops the text?

130 Views Asked by At

My NSAlert has 2 buttons. I changed the font of a button but its frame doesn't auto-resize to crops its text.
I have tried changing the frame of the button, use sizeToFits, set attribute title, ... but it didn't work.
How can I make the button to crops the text? Is it possible? Thanks.

Here is a screenshot of the button:

button screenshot

I use this code to change the button's font:

alert.buttons[0].font = NSFont.systemFont(ofSize: 25.5)
0

There are 0 best solutions below