• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView bug?


  • Subject: Re: NSOutlineView bug?
  • From: John Stiles <email@hidden>
  • Date: Wed, 3 Aug 2005 14:45:01 -0700

This worked like a charm!! Thanks for your help.

NSMutableParagraphStyle *middleTruncationParagraphStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];
[middleTruncationParagraphStyle setParagraphStyle: [NSParagraphStyle defaultParagraphStyle]];
[middleTruncationParagraphStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];


[attributedNameString addAttribute:NSParagraphStyleAttributeName
value:middleTruncationParagraphStyle
range:NSMakeRange(0, [attributedNameString length])];


On Aug 3, 2005, at 2:24 PM, Philip Dow wrote:

John, you must apply an NSParagraph style as one of the attributes to the string.

Create an NSMutableParagraphStyle with:
[NSMutableParagraphStyle defaultParagraphStyle]

then add the line break mode with
- (void)setLineBreakMode:(NSLineBreakMode)mode

mode can be one of the following:
NSLineBreakByWordWrapping
NSLineBreakByCharWrapping
NSLineBreakByClipping
NSLineBreakByTruncatingHead
NSLineBreakByTruncatingTail
NSLineBreakByTruncatingMiddle

Finally add this paragraph style to your attributed string like you would any attribute.

See NSParagraphStyle documentation for more info.

-Phil
http://phildow.net

Am 03.08.2005 um 23:08 schrieb John Stiles:


I noticed an issue with my NSOutlineView and I was wondering if this constitutes a bug in AppKit.

One of my table columns contains an NSAttributedString; this string contains an image, and then some text which has one attribute applied to it (its baseline is raised by a few pixels to help center it against the image).

When I shrink down this table column, the text does not truncate as I would expect--i.e. with a name like "This Is A Very Long String", it would get an ellipsis at the end like "This Is A Very Lo...". Instead, individual words just vanish, so I'm left with "This Is A Very" and no ellipsis. To make matters worse, most entries in the list are really just long words without spaces in them, and in those cases they just vanish abruptly, and I'm left with just the icon.

Is this worthy of a bug report? _______________________________________________
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




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden


_______________________________________________ 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
References: 
 >NSOutlineView bug? (From: John Stiles <email@hidden>)
 >Re: NSOutlineView bug? (From: Philip Dow <email@hidden>)

  • Prev by Date: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Next by Date: Re: NSOutlineView and NSTreeController
  • Previous by thread: Re: NSOutlineView bug?
  • Next by thread: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Index(es):
    • Date
    • Thread