0

I'm using InAppStorewindow (https://github.com/indragiek/INAppStoreWindow) to cuztomize my NSWindows's title bar. What i'm trying to do is to add a logo (image) to my title bar in center position:

NSSize logoSize = self.logo.frame.size;
NSRect logoFrame = NSMakeRect(NSMidX(self.window.titleBarView.bounds) - (logoSize.width / 2.f),
                                 NSMidY(self.window.titleBarView.bounds) - (logoSize.height / 2.f),
                                 logoSize.width, logoSize.height);

self.logo.frame = logoFrame;

I put the above code in applicationDidFinishedLaunching method.

it works fine, however if I click on the green resize button, the position won't change. So how am I going to call the above code to reposition my logo, when the resize button is clicked and performZoom: is called?

Josh
  • 692
  • 2
  • 9
  • 38

1 Answers1

0

You can use the NSWindowDelegate Method

- (void)windowDidResize:(NSNotification *)notification

By that you will know when the window is resized so you can recalculate the position of your logo.

uem
  • 713
  • 1
  • 7
  • 18