开发者

How do I increase the height of the title bar in a Cocoa application? [duplicate]

This question already has answers here: How to change the height of an NSWindow titlebar? (4 answers) Closed 2 years ago.

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜