我有一个菜单栏应用程序,它打开一个弹出窗口。该弹出窗口包含 NSTextField 和几个按钮。问题是 NSTextField 是不可选择的,无法在其中输入任何内容。但是,可以用鼠标右键单击它并粘贴某些内容。嗯,这绝对是奇怪的行为。顺便说一句,按钮在弹出窗口中工作没有任何问题。
这是我使用的代码:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[NSApp activateIgnoringOtherApps:YES];
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
[statusItem setAction:@selector(showPopOver:)];
[statusItem setImage:[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"png"]]];
[statusItem setHighlightMode:YES];
}
and:
- (IBAction)showPopOver:(id)sender {
popover = [[NSPopover alloc] init];
[popover setContentViewController:popOverController];
popover.animates = YES;
popover.delegate = self;
[popover showRelativeToRect:[sender bounds]
ofView:sender
preferredEdge:NSMaxYEdge];
}
}
有什么想法到底是什么问题以及如何解决它吗?
似乎是一个错误。http://openradar.appspot.com/9722231 http://openradar.appspot.com/9722231
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)