Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > setTextColor using Objective-C

setTextColor using Objective-C
Thread Tools
planemaniac
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Jun 6, 2007, 04:46 PM
 
Hi,

I'm having quite a lot of trouble using setTextColor to change the color of everything in NSTextView to any color. Could someone please give me an example of how to do this? I'm a very new developer just getting to grips with things. If you need any more source code etc. please ask.

Regards, George
     
WJMoore
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jun 7, 2007, 03:11 AM
 
I think you want to use changeColor: instead.
     
planemaniac  (op)
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Jun 7, 2007, 07:18 AM
 
What I'm really looking for is an example, showing how to implement this. Cheers
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jun 7, 2007, 04:15 PM
 
It works exactly like any other method. Assuming you have a reference to an NSTextView in a variable called myTextView:
[codex][myTextView setTextColor:[NSColor redColor]];[/codex]
Now everything is red.
( Last edited by Chuckit; Jun 7, 2007 at 04:23 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
planemaniac  (op)
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status: Offline
Reply With Quote
Jun 7, 2007, 04:40 PM
 
Hi,

That's really helpful, thanks, it now works. Sorry, I didn't know how to use methods or anything - I'm sort of new to this (well, very new). I suppose I should have got the hint from [NSColor ...... ] in the documentation!

Thanks,

Regards, George.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:04 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,