O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSBox — Mac OS X 10.0

Synopsis

This simple subclass of NSView performs two tasks: it can draw a border around itself, as well as title itself. By specifying that the box should have no border or title, NSBox views can be used to transparentlly group other NSView objects by making them subviews of the box view. Interface Builder provides facilities for using NSBox to group views.

image with no caption

@interface NSBox : NSView
                                  // Accessor Methods
   - (void)setTitle:(NSString *)aString;
   - (NSString *)title;
   - (void)setBorderType:(NSBorderType)aType;
   - (NSBorderType)borderType;
   - (void)setBoxType:(NSBoxType)boxType;
   - (NSBoxType)boxType;
   - (void)setTitlePosition:(NSTitlePosition)aPosition;
   - (NSTitlePosition)titlePosition;
   - (void)setFrameFromContentFrame:(NSRect)contentFrame;
   - (void)setTitleFont:(NSFont *)fontObj;
   - (NSFont *)titleFont;
   - (void)setContentView:(NSView *)aView;
   - (id)contentView;
   - (void)setContentViewMargins:(NSSize)offsetSize;
   - (NSSize)contentViewMargins;
                                  // Instance Methods
   - (NSRect)borderRect;
   - (void)sizeToFit;
   - (id)titleCell;
   - (NSRect)titleRect;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required