New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

NSTextField doesnt change textColor


Post Reply New Thread Subscribe

 
Thread Tools
VaStO

 
Member Since: Oct 01, 2010
Posts: 7
VaStO is on a distinguished road

VaStO is offline
Hi.

I need change the text color of a NSTextField with method setTextColor: (NSColor*) color. But at GUI doesnt change it, internally does it but isnt visibility.
[[myTextField cell] setTextColorcolorWellSource color]];
[myTextField updateCell: [myTextField cell]];


If anybody can help, ill be grateful. Thx
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Perhaps in your first line you should not be using [myTextField cell], but rather just myTextField. The setTextColor is not part of the NSControl class which is where the cell is coming from.

You might also have to say YES to setAllowsEditingTextAttributes:.

And if the updateCell: call isn't working, then perhaps try setNeedsDisplay:. I'd start by just commenting out that line.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
VaStO

 
Member Since: Oct 01, 2010
Posts: 7
VaStO is on a distinguished road

VaStO is offline
Thx.

I tried from NSTextField class with just setTextColor and later display but isnt work.

I tried with NSCell cuz is the class whi has the setTextColor method...but nothing works...

Any other idea?? ANyway thx man
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
I was just playing around with this. I found I had to get the connections just right in Interface Builder. In my case, I associated the text outlet my delegate object and then the instructions worked.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
VaStO

 
Member Since: Oct 01, 2010
Posts: 7
VaStO is on a distinguished road

VaStO is offline
In this case i dont have an IBOutlet associated, cuz its an grafical editor and i get the objects throught and IBAction (id) sender..
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Sounds like you need to do some debugging. Start with proving the sender and the myTextField are non nil and are the same object.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
VaStO

 
Member Since: Oct 01, 2010
Posts: 7
VaStO is on a distinguished road

VaStO is offline
Isnt nill cuz y loggin
NSLog(@"Color of Selected: %@",[myTextFiled colorText]);
and says the color with alpha and everything... and i asiggn it to the ColorWell and does good...
[colorWellSorce setColor: [myTextField colorText]];
and color well changes color propertly, but never the textField.
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Not seeing the entire code makes it difficult to help. Good luck.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
VaStO

 
Member Since: Oct 01, 2010
Posts: 7
VaStO is on a distinguished road

VaStO is offline
Srry, i cant cuz its of my job...thats the code im using,
QUOTE Thanks

Post Reply New Thread Subscribe


« plz c this fortran code | setFile Missing? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting 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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Barack Obama is in Michigan! THE TIME FOR CHANGE IS NOW! Tanner31593 Schweb's Lounge 89 05-15-2008 11:26 PM
Change in System User name Harrisrc1 OS X - Operating System 8 01-05-2008 05:39 PM
1How to change the look of the folders the8thark OS X - Operating System 8 11-20-2007 01:58 PM
Ok to change just the "Name" of my admin account? RiDE OS X - Operating System 2 07-25-2007 11:36 PM
Help: Sudden (unexpected) change of language in00b Apple Notebooks 5 10-06-2005 04:03 PM

All times are GMT -4. The time now is 05:38 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?