If I create a project in Xcode 4.1, and set the MainMenu.xib to have two NSPanels, and put a NSTextField in both panels, if I set one of the NSPanels to not show the "Title Bar", then the textfield within that panel can not be clicked on or given focus.
Why??
A window (or a panel) without a titlebar cannot become key, so it can't get the focus. You have to subclass it and override its - (BOOL)canBecomeKey
method, like this:
@interface MyPanel : NSPanel
@end
@implementation MyPanel
- (BOOL)canBecomeKeyWindow {
return YES;
}
@end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With