How do I increase the height of the title bar in a Cocoa application? [duplicate]
I have the following code for setting up my interface in a Cocoa application:
#import <Foundation/Foundation.h>
@interface uiview : NSObject {
IBOutlet NSWindow *mainWindow;
IBOutlet NSView *accessoryView;}
// Methods
- (void)composeInterface;
-(IBAction)button : (id)sender;
@end
#import "uiview.h"
@implementation uiview
- (void)awakeFromNib
{
[self composeInterface];
[mainWindow setTitleWithRepresentedFilename:@"/Users/parag/Documents/UIview"];
}
- (void)composeInterface
{
NSView *themeFrame = [[mainWindow contentView] superview];
NSRect c = [themeFrame frame];
NSRect aV = [accessoryView frame];
NSRect newFrame = NSMakeRect(
c.size.width - aV.size.width, // x position
c.size.height - aV.size.height, // y position NSPoint
aV.size.width, // width
aV.size.height); // height //NSSize
[accessoryView setFrame:newFrame];
[themeFrame addSubview:accessoryView];
}
How can I inc开发者_如何学Pythonrease the height of the window's title bar area, like the Mac App Store application does?
Actually, the App Store app has no title bar. This is probably an abuse of Apple's own user interface guidelines. So don't emulate them.
精彩评论