复制/粘贴在模态窗口中不工作 [英] Copy/Paste Not Working in Modal Window

查看:144
本文介绍了复制/粘贴在模态窗口中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的可可应用程序中,我显示一个NSPanel作为另一个NSPanel的模态'窗口'使用:

  [modalPanel setWorksWhenModal :是]; 
[[NSApplication sharedApplication] beginSheet:modalPanel modalForWindow:mainPanel modalDelegate:nil didEndSelector:nil contextInfo:nil];

这样可以工作,但是在模态'窗口'中显示的NSTextField不允许复制和粘贴。



从搜索我发现以下线程Cocoabuilder,似乎几乎相同的问题,但是没有解决方案给出在那个线程。



http:// www.cocoabuilder.com/archive/message/cocoa/2007/11/6/192462



该线程要求确保您不停止复制/通过使用验证粘贴,但这不是我的情况,因为我目前没有任何验证的任何字段。



有什么特别的我要做



谢谢!



如果删除编辑菜单,则会丢失内置的编辑菜单。复制和粘贴功能。


In my cocoa app I am displaying a NSPanel as a modal 'window' of another NSPanel using:

[modalPanel setWorksWhenModal:YES];
[[NSApplication sharedApplication] beginSheet:modalPanel modalForWindow:mainPanel modalDelegate:nil didEndSelector:nil contextInfo:nil];

This works, however the NSTextField's that show up in that modal 'window' are not allowing copy and paste.

From searching I found the following thread on Cocoabuilder which seems like pretty much the same problem, however there was no solution given in that thread either.

http://www.cocoabuilder.com/archive/message/cocoa/2007/11/6/192462

That thread says to make sure you are not stopping copy/paste by using validation, but this is not the case for me as I currently do not have any validation on any of the fields.

Is there something special I have to do to get this to work, or does anyone have any ideas of what I could check/try?

Thanks!

解决方案

Is the "Edit" menu present in your application?

If you delete the edit menu, you lose the built in copy and paste functionality.

这篇关于复制/粘贴在模态窗口中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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