文档表不响应键盘事件
我认为这是第一响应者的问题,但我不确定。我正在为表视图中的数据实现一个编辑窗口。在概念上与 Mail.app 中编辑过滤器规则的 UI 非常相似。
我有一个编辑窗口,我将其附加到主窗口:
[NSApp beginSheet: criteriaEditPanel
modalForWindow: [self window]
modalDelegate: self
didEndSelector: @selector(criteriaEditDidEnd:returnCode:contextInfo:)
contextInfo: (void *)[criteriaList objectAtIndex: index]];
面板从主窗口的标题栏正确显示。我可以使用鼠标操作面板上的弹出控件,但无法编辑文本字段,也无法在字段之间进行切换。其他一切都很好。有什么想法吗?
乔
I think it's a first responder problem, but I'm not sure. I'm implementing an edit window for data in a table view. Very similar in concept to the UI for editing filter rules in Mail.app.
I have an editing window that I attach to my primary window with:
[NSApp beginSheet: criteriaEditPanel
modalForWindow: [self window]
modalDelegate: self
didEndSelector: @selector(criteriaEditDidEnd:returnCode:contextInfo:)
contextInfo: (void *)[criteriaList objectAtIndex: index]];
The panel displays properly, from the title bar of the main window. I can manipulate the pop-up controls on the panel with the mouse, but I can't edit the text fields and I can't tab between fields. Everything else works fine. Any ideas?
joe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。不管你相信与否,您必须为面板启用标题栏,即使它在显示为工作表时永远不可见。当在 IB 中启用它时,键盘输入开始工作。
@spudwaffle - 没有任何对象被检查拒绝第一响应者。
Solved. Believe it or not, you have to have the Title Bar enabled for the panel, even though it's never visible when displayed as a Sheet. When enabled it in IB, keyboard input started working.
@spudwaffle - none of the objects had Refuse First Responder checked.