On Nov 11, 2020, at 08:54:02, Andreas Falkenhahn via Cocoa-dev 
<cocoa-dev@lists.apple.com> wrote:
> 
> However, this still isn't perfect because the last two characters of the 
> widest entry are still cut off and replaced by "...". Of course, I can solve 
> this by just adding something a few points to size.width but of course I 
> don't want that because I'm looking for a solution that works with all UI 
> fonts and sizes so hard-coding a certain point value that is added to 
> size.width is definitely a no-go...

Yes, just add a fudge factor to ensure the column will be wide enough to 
accommodate the string width AND the spacing between the left and right edges 
of the actual NSTextField in the cell. You can inspect the field in the table 
to see those distances.

You might even be able to mess with the constraints on the text field to force 
field to never shrink smaller than the text by adding constraints to the field 
and setting the Content Compression Resistance Priority, Horizontal to 1000 or 
something at least higher than 750. Try turning on the field's Single Line Mode 
as well.

--
Steve Mills
Drummer, Mac geek

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to