开发者

Subclassing NSBox

开发者 https://www.devze.com 2023-03-02 07:34 出处:网络
How could I subclass a NSBox to change the width, height , font type and background co开发者_JAVA百科lor of the Box\'s title?. Most of those look like they can be set with simple calls to NSBox\'s acc

How could I subclass a NSBox to change the width, height , font type and background co开发者_JAVA百科lor of the Box's title?.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消