Re: NSTextField woes
Re: NSTextField woes
- Subject: Re: NSTextField woes
- From: David Blanton <email@hidden>
- Date: Wed, 4 Mar 2009 13:34:32 -0700
the following works for me ...
NSMutableParagraphStyle *ps;
ps = [[NSMutableParagraphStyle alloc] init];
[ps setAlignment:NSLeftTextAlignment];
_leftAlign = [[NSDictionary alloc] initWithObjectsAndKeys: [NSFont
systemFontOfSize:12.0], NSFontAttributeName, ps,
NSParagraphStyleAttributeName, [NSColor blueColor],
NSForegroundColorAttributeName, nil];
[_value drawInRect:cellFrame withAttributes:_leftAlign];
On Mar 4, 2009, at 12:13 PM, Robert Bielik wrote:
Hi all,
I have a NSTextField in which I'd like to change the selected text
color. From various sources I've got this:
NSTextView* tv = (NSTextView*)[[m_nstextfield window]
fieldEditor:YES forObject:m_nstextfield];
[tv setSelectedTextAttributes:[NSDictionary dictionaryWithObject:
[NSColor blackColor] forKey:NSForegroundColorAttributeName]];
but noo... I can't get anything but the default color, i.e. same as
the normal text color.
Ideas?
TIA
/Rob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
40tularosa.net
This email sent to email@hidden
David Blanton
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden