Guest User

Untitled

a guest
Jul 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] initWithString:value] autorelease];
  2. NSDictionary *attributes = [[NSDictionary dictionaryWithObjectsAndKeys:
  3. [NSFont systemFontOfSize:[NSFont systemFontSize] -1], NSFontAttributeName,
  4. [NSColor disabledControlTextColor], NSForegroundColorAttributeName, nil] retain];
  5.  
  6. [result addAttributes:attributes range:[value rangeOfString:value]];
  7.  
  8. NSString *titleValue = @"TEST";
  9. NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc] initWithString:titleValue];
  10. NSColor *color = [self isHighlighted] ? [NSColor whiteColor] : [NSColor blackColor];
  11. NSDictionary *attributes = [[NSDictionary dictionaryWithObjectsAndKeys:
  12. [NSFont boldSystemFontOfSize:[NSFont systemFontSize] + 1], NSFontAttributeName,
  13. color, NSForegroundColorAttributeName, nil] autorelease];
  14. [titleString addAttributes:attributes range:[titleValue rangeOfString:titleValue]];
  15. [self setAttributedStringValue:value];
Add Comment
Please, Sign In to add comment