NSTextField does not change text color


hi guys,

i'm having trouble setting colors 'nstextfield' instance.

here screenshots

set rgb values using 'colorwithcalibratedred' api of nscolor 'nstextfield' instance. values dont seem change

green label here
screen shot 2014-12-15 @ 10.44.10 am.png

changing red value makes change yellow
screen shot 2014-12-15 @ 10.44.19 am.png

changing red value not change output - yellow always
screen shot 2014-12-15 @ 10.44.36 am.png

adding value blue textbox, removes color!
screen shot 2014-12-15 @ 10.44.44 am.png

code - 'self.color' instance of nstextfield
nstextfield *color;

code:
  - (ibaction)onaddcharacter:(id)sender  {      float redvalue = [self.red.stringvalue floatvalue];      float greenvalue = [self.green.stringvalue floatvalue];      float blueval = [self.blue.stringvalue floatvalue];      float alphaval = [self.alpha.stringvalue floatvalue];            nscolor *mytodaycolor = [nscolor colorwithcalibratedred:redvalue green:greenvalue blue:blueval alpha:alphaval];            [self.color setfont:[nsfont fontwithname:@"arial" size:48]];      self.color.refusesfirstresponder = yes;      [self.color settextcolor:mytodaycolor];      [self.color setstringvalue:@"some text"];      //[textfield setbackgroundcolor:[nscolor blackcolor]];      [self.color setdrawsbackground:yes];      [self.color setbordered:no];        }  
what can problem , missing?

in advance!
 

the class method colorwithcalibratedred asks cgfloat , you're feeding float
maybe that's problem
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Snow Angels: Men Dig Out Moose Buried By Avalanche

Error installing Key Agent drivers in Windows 7

IOH Heatsink & CPU B Core 0 Relative to ProcHot