Results 1 to 9 of 9
  1. #1


    Member Since
    Oct 01, 2010
    Posts
    7
    NSTextField doesnt change textColor
    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

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    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.

  3. #3


    Member Since
    Oct 01, 2010
    Posts
    7
    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

  4. #4

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    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.

  5. #5


    Member Since
    Oct 01, 2010
    Posts
    7
    In this case i dont have an IBOutlet associated, cuz its an grafical editor and i get the objects throught and IBAction (id) sender..

  6. #6

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    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.

  7. #7


    Member Since
    Oct 01, 2010
    Posts
    7
    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.

  8. #8

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    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.

  9. #9


    Member Since
    Oct 01, 2010
    Posts
    7
    Srry, i cant cuz its of my job...thats the code im using,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can you change itunes ID when you change new email?
    By simonvee in forum OS X - Operating System
    Replies: 6
    Last Post: 02-08-2014, 10:08 AM
  2. Newbie problem with NSTextField
    By Pengwin in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 07-06-2013, 03:07 PM
  3. change background doesnt open
    By safarisurfer in forum Switcher Hangout
    Replies: 2
    Last Post: 09-10-2012, 04:43 AM
  4. Replies: 3
    Last Post: 10-22-2010, 02:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •