• 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: NSTextField woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTextField woes (From: Robert Bielik <email@hidden>)

  • Prev by Date: Re: Text scrolling with Finder-like label editing. Will a raw field editor (NSTextView) do this, or should I use an NSTextField or NSTextFieldCell?
  • Next by Date: Re: Date parsing problem (when running on iphone only)
  • Previous by thread: Re: NSTextField woes
  • Next by thread: Re: Newbie: Learning path for my GTD app...
  • Index(es):
    • Date
    • Thread