For macOS.
Is it possible to change set the width for a MenuItem. Now it always takes the longest entries length.
But I need to make the width to a certain chars.
BTW Adding spaces to the menuItem name (value) make it wider is no option.
For macOS.
Is it possible to change set the width for a MenuItem. Now it always takes the longest entries length.
But I need to make the width to a certain chars.
BTW Adding spaces to the menuItem name (value) make it wider is no option.
NSMenu has a minimumWidth but not a maximum it seems.
https://developer.apple.com/documentation/appkit/nsmenu/1518221-minimumwidth
There is a size property, but it’s unclear from the documentation if setting it would have an effect. I think the easiest approach would be to just truncate the text yourself.
And if you do not want a 256 bytes (characters) MenuItem.Text, do not provide one with all those characters (IMHO)
BTW: I ay understand your problem, but OSes are built in certains ways.
Nota: in my 40 years of computer use, I never think about a max length in a MenuItem name. (on file name length, once they left the 31 chars max, I never searched, but there there is another max size, way longer).