nsviewcontroller// nsbutton background color , why nsbutton setbackgroundcolor does not display the color ? when display the nsviewcontroller

Hello,


Sorry for my langage , i am french.


I have a view in a nsobject.


I have a view with a button in a nsviewcontroller , for the button : i don't see the color when the view is displayed.


I do in the nsobject :

[MclViewControl addSubview : [MclViewController view] ];


[[MclViewController view] setFrame : [MclViewControl bounds]];





But I do in the nsviewcontroller : - (void)viewDidLoad


Boolean W_BooleanColor = [SaiMclTitTxt drawsBackground];

if (W_BooleanColor == false)

{

[SaiMclTitTxt setDrawsBackground : true];

}

[SaiMclTitTxt setBackgroundColor : [NSColor blackColor]];



[[SaiMclValider cell] setBackgroundColor : NSColor.cyanColor];


For the label the background color is displayed (Ok).


Why not for the nsbutton ?


Thank you.

Replies

To change the color of a UIButton:

[myButton setBackgroundColor:[UIColor greenColor]];


(use the "<>" button above to show code on this forum)