|
|
setTextColor using Objective-C
|
|
|
|
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status:
Offline
|
|
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
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status:
Offline
|
|
I think you want to use changeColor: instead.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status:
Offline
|
|
What I'm really looking for is an example, showing how to implement this. Cheers
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
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'."
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Aug 2006
Location: London, UK
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|