NSTextView with transparent text?
NSTextView with transparent text?
- Subject: NSTextView with transparent text?
- From: Doug Brown <email@hidden>
- Date: Sun, 17 Mar 2002 19:02:42 -0800
Hi,
I'm trying to make the text in an NSTextView transparent - here's my
code which takes an NSAttributedString. Does anyone have any ideas why
this won't work?
NSMutableAttributedString *attStr;
NSAttributedString *temp;
NSString *sAppend (contains a string to be appended)
(chatTextView is an outlet connected to a NSTextView)
attStr = [[NSMutableAttributedString alloc] initWithRTF:[chatTextView
RTFFromRange:NSMakeRange(0, [[chatTextView string] length])]
documentAttributes:nil];
temp = [[NSAttributedString alloc] initWithString:sAppend
attributes:[NSDictionary dictionaryWithObjectsAndKeys:[[NSColor
redColor] colorWithAlphaComponent:0.5], NSForegroundColorAttributeName,
[NSFont userFixedPitchFontOfSize:0.0], NSFontAttributeName, nil]];
[attStr appendAttributedString:temp];
[chatTextView replaceCharactersInRange:NSMakeRange(0, [[chatTextView
string] length]) withRTF:[attStr RTFFromRange:NSMakeRange(0, [attStr
length]) documentAttributes:nil]];
I hope this is enough example code. By the way, while I'm on the
subject, is there anything I'm doing wrong with my current code other
than the alpha values? I'm writing an IRC client. Thanks,
Doug
_______________________________________________
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.