Truncating strings to fit a text field
Truncating strings to fit a text field
- Subject: Truncating strings to fit a text field
- From: Mark Alldritt <email@hidden>
- Date: Thu, 25 Mar 2004 19:50:10 -0800
Hi All,
Sorry to bug you all with a simple Cocoa question, but search as I might, I
cannot find a simple answer to this.
I want to display a file path in a NSTextField instance. I want to truncate
a long file path with a ... (like I can do in Carbon with
TruncString/TruncText). What's the magic incantation to make this happen in
Cocoa?
There is NSString's sizeWithAttributes, but I don't see anything that will
"do the right thing" given an available width.
Cheers
-Mark
---------------------------------------------------------------------
Mark Alldritt Late Night Software Ltd.
Phone: 250-380-1725 333 Moss Street
FAX: 250-383-3204 Victoria, B.C.
WEB:
http://www.latenightsw.com/ CANADA V8V-4M9
AIM: markalldritt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.