My application has an icon in the menu bar. A NSPanel appears when I click the icon. But why NSPanel n't the NSPanel have a background color like another with a gray NSWindow background? My NSPanel background looks transparent. My NSPanel comes from a .xib file. My code is as follows:
(void)openPanel { NSLog(@"openPanel"); NSWindow *panel = self.panelController.window; NSRect rect = [[[NSApp currentEvent] window] frame]; NSLog(@"rect.origin.x = %f",rect.origin.x); NSLog(@"rect.origin.y = %f",rect.origin.y); NSLog(@"rect.size.width = %f",rect.size.width); NSLog(@"rect.size.height = %f",rect.size.height); [panel setFrame:NSMakeRect(rect.origin.x, rect.origin.y-100, 200, 100) display:YES]; [NSApp activateIgnoringOtherApps:NO]; [panel makeKeyAndOrderFront:nil]; isPanelVisible = YES; }
source share