3
私は、ポップオーバーを開くメニューバーアプリケーションを持っています。そのポップオーバーにはNSTextFieldといくつかのボタンが含まれています。問題は、NSTextFieldが選択できないことです。何も入力することは不可能です。ただし、マウスの右ボタンでクリックして貼り付けることは可能です。まあ、それは間違いなく奇妙な行動です。ボタンはそのpopover、btwで問題なく動作します。NSTopFieldはNSPopOverでアクティブではありません
- (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];
}
と::
- (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];
}
}
任意のアイデアまさに問題とどのようにそれを修正する
ここで私が使用するコードですか?
この質問のBalazs Tothが修正されました:http://stackoverflow.com/questions/7214273/nstextfield-on-nspopover/7794324#7794324 – suda