I'm using INAppStoreWindow for my application. I put an NSSearchButton
in the title bar of the application.
INAppStoreWindow *aWindow = (INAppStoreWindow*)self.window;
aWindow.titleBarHeight = 60.0;
aWindow.showsTitle = YES;
NSView *titleBarView = aWindow.titleBarView;
NSSize buttonSize = NSMakeSize(200.f, 100.f);
NSRect buttonFrame =
NSMakeRect(NSMidX(titleBarView.bounds) - (buttonSize.width / 2.f),
NSMidY(titleBarView.bounds) - (buttonSize.height / 2.f),
buttonSize.width,
buttonSize.height);
The previous code positioned the search box at the center of the title bar. What I want to do is position the search box at the left side of the title bar and if "Maximize" button of the application is clicked, I want the search box to remain at left. (not exact left. I want the left where there is a space between the search box and the left edge of the title bar).
Of course, I want to leave a space for the "full screen" arrows.
I'm not really familiar with Cocoa development (yet).
How to position my search box as I want?