文档表不响应键盘事件 [英] Document sheet not responding to keyboard events

查看:96
本文介绍了文档表不响应键盘事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是急救人员的问题,但我不确定.我正在为表格视图中的数据实现一个编辑窗口.在概念上与用于在Mail.app中编辑过滤器规则的UI非常相似.

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?

推荐答案

已解决.信不信由你,您必须为面板启用标题栏,即使将其显示为工作表也不可见.在IB中启用该功能后,键盘输入开始起作用.

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-没有任何对象已 拒绝第一响应者 被选中.

@spudwaffle - none of the objects had Refuse First Responder checked.

这篇关于文档表不响应键盘事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆