objective c - How to change the color of the tab button and the view itself in NSTabView? -


i working on os x app, , using nstabview. change background color of tab (button). background blue, (attribute inspector -> appearance = inherited (aqua).

same true background color of view itself. subclass nstabview, , add inside code:

 cgcontextref context = (cgcontextref) [[nsgraphicscontext currentcontext] graphicsport];  cgcontextsetrgbfillcolor(context, 241.0/255.0, 252.0/255.0, 255.0/255.0, 1.0);  cgcontextfillrect(context, nsrecttocgrect(dirtyrect)); 

which change background color, cover tabs background color...

any customization of nstabview appreciated.

for jump conclusion duplicate question...please take on dates in answers on similar questions...they old 7-8 years...

after couple of hours, think can't nstabview. documentation says can no longer , nstabview respect theme chosen os instead.

this led me how draw own nstabview tabs?, i'm sure you've seen. despite documentation, setimage/forsegment did not work me.

[nssegmentedcontrol colors seems have found 1 solution, , smsegmentview another, although there may licensing issues. both these solutions more recent.

i hope above prove useful , luck.


Comments