• 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
Scrolling NSOutlineView makes attributed string bold
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scrolling NSOutlineView makes attributed string bold


  • Subject: Scrolling NSOutlineView makes attributed string bold
  • From: Rod Schmidt <email@hidden>
  • Date: Sat, 23 Sep 2006 13:15:49 -0600

I have a NSOutlineView in a sheet. The outline view has one column. each value is an HTML string converted to a NSAttributedString. Whenever I scroll the outline view the values because darker almost like they are becoming bold. If I select a value the bold goes away. Sometimes when I scroll fast the bold goes away but it comes back as soon as I scroll again. Here's the code that creates the values:

- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
{
static NSMutableParagraphStyle *style = nil;
if (style == nil)
{
style = [[NSMutableParagraphStyle alloc] init];
[style setLineBreakMode: NSLineBreakByTruncatingTail];
}


    WebPreferences *webPrefs = [WebPreferences standardPreferences];

    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
        webPrefs, NSWebPreferencesDocumentOption,
        nil];

    NSString *html = [pageGenerator titleForList: item];
    NSData *htmlData = [html dataUsingEncoding: NSUTF8StringEncoding];

NSMutableAttributedString *result = [[NSMutableAttributedString alloc] initWithHTML: htmlData
options: options
documentAttributes: nil];


NSFont *font = [NSFont fontWithName: @"Lucida Grande" size: [item isItem] ? 13.0 : 16.0];
NSRange entireRange = NSMakeRange(0, [result length]);
[result addAttribute: NSFontAttributeName value: font range: entireRange];
[result addAttribute: NSParagraphStyleAttributeName value: style range: entireRange];


    return [result autorelease];
}

Anybody have any idea what the problem is?

Thanks,

Rod Schmidt
_______________________________________________
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


  • Prev by Date: Re: NSDatePicker and NSNull
  • Next by Date: Re: [IBPalette] inspectorClassName returns (null)
  • Previous by thread: Re: [IBPalette] inspectorClassName returns (null)
  • Next by thread: Making a window transparent to some events, but not others
  • Index(es):
    • Date
    • Thread