macoscocoanscolornstabview

NSTabView with background color


As discussed elsewhere, NSTabView does not have a setBackgroundColor method and subclassing NSTabView and using an drawRect to control it does no longer work - as it does not paint the top 10%, the bit just below the segmented control button.

Now I am a bit surprised by the amounts of work arounds I had to do solving this; see

and am wondering if i went down the wrong path. And how to do this better & simpler:

Feedback appreciated - as this feels so far off/suboptimal for such a simple things -- Thanks a lot. Brownie points for hacking/forking the github code :) :) :) As a line of running code says more than a thousand words.

Dw.


Solution

  • PSMTabBarControl is probably the best workaround for you. I have created several custom tab views, but cocoa does not play well with this control. PSMTabBarControl has been updated to support Xcode 4. https://github.com/ciaran/psmtabbarcontrol