Changing color in interface without code

Hi
I found in xcode “user defined runtime attributes”
For a window, if i put in this area : backgroundColor and set for example in black
The background of my window came black when the aplication is running

I tried to change the color of a textfiel with this method but doesn’t work

Do you know how to use this parameter ?
Thanks
Regards
Christophe

Are you doing this in interface builder?

There is no user defined attribute for a text field
In inspector panel in IB there is a attribute for the
The text field for the background colour.

To do this programmatically you’ll need to create
An IBOutlet NSTextfield property in your class.
Create (Drag) an Blue Object into your IB.
Assign it’s class to your class. Then in the Outlets panel
Connect that to your textfield.

Then in your class you can set you instance textField
Properties background colour.

https://developer.apple.com/documentation/appkit/nstextfield/1399389-backgroundcolor?language=objc

You may also have to set its drawsBackgroundColor property to true

https://developer.apple.com/documentation/appkit/nstextfield/1399416-drawsbackground?language=objc

And more on NSTextfield
https://developer.apple.com/documentation/appkit/nstextfield?language=objc

And NSTextFieldCell
https://developer.apple.com/documentation/appkit/nstextfieldcell?language=objc

Hi
Thanks a lot technomorph.
I start to understand. but i think that i forgot to explai that my app is an Applescript
So how can i create those classes to overide default value ?
I found that i need to create 2 files .h and .m. What shouls i write in them ?
Never made Cocoa so very loose
Regards. Chris.