Question

How could I subclass a NSBox to change the width, height , font type and background color of the Box's title?.

Was it helpful?

Solution

Most of those look like they can be set with simple calls to NSBox's accessors, and the size and background color can be set by calling [myBox title] then calling the appropriate methods on the returned NSCell.

So subclassing NSBox to do all of these things would be as simple as setting the right properties in -init, and making sure to override the methods listed in the "Subclassing Notes" section within NSBox's Class Reference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top