NSTextField and NSLineBreakByTruncatingMiddle
NSTextField and NSLineBreakByTruncatingMiddle
- Subject: NSTextField and NSLineBreakByTruncatingMiddle
- From: Joshua Scott Emmons <email@hidden>
- Date: Fri, 20 Jan 2006 21:18:41 -0600
Normally when I know a NSTextField is going to be holding more text
than it can display, I set it to wrap and break lines on word
boundaries like so:
[[myTextField cell] setWraps:YES];
[[myTextField cell] setLineBreakMode:NSLineBreakByWordWrapping];
It works perfectly.
Today, I started working on an app in which I wanted to break long
lines by truncating them in the middle. I thought all I would have to
do is:
[[myTextField cell] setWraps:YES];
[[myTextField cell] setLineBreakMode:NSLineBreakByTruncatingMiddle];
Or maybe:
[[myTextField cell] setWraps:NO];
[[myTextField cell] setLineBreakMode:NSLineBreakByTruncatingMiddle];
But neither of these behaves as I would expect. Both prevent the text
from wrapping (as the lines are no longer being split on words), but
neither does anything to truncate the string. I'm pretty sure
NSLineBreakByTruncareingMiddle is supposed to be working in 10.3+,
right? I'm working in 10.4, and getting no love. Am I just horribly
misusing -setLineBreakMode:?
Cheers,
-Joshua Emmons
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden