如何在显示模态表时禁用Cocoa的默认动画? [英] How can I disable Cocoa's default animation when displaying a modal sheet?

查看:146
本文介绍了如何在显示模态表时禁用Cocoa的默认动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用Cocoa在显示模态工作表时执行的动画。

I would like to disable the animation that Cocoa performs when displaying a modal sheet.

Apple的工作表编程指南说明:


...应用程序包会自动处理其他工作表行为,例如动画出现和关闭时的动画。

... Other sheet behavior, such as the animation when it appears and is dismissed, is handled automatically by the Application Kit.

但它不提供任何有关如何禁用此效果的提示。

But it doesn't provide any hints on how to disable this effect.

一个自定义表单(一个透明背景和一些控件在其中的NSWindow的子类)。我可以使用标准的beginSheet方法如下显示它:

I have created a custom sheet (a subclass of NSWindow with a transparent background and some controls in it). I am able to display it using the standard beginSheet method as follows:

[NSApp beginSheet:myCustomSheet
   modalForWindow:mainWindow
    modalDelegate:self
   didEndSelector:...];

工作表显示正常,但是它会在出现时显示动画,

The sheet displays fine, but it goes through an animation when it appears, and again when it closes.

请注意:我为触摸屏/信息亭类型应用编写了一个完全自定义的用户界面,因此没有任何常见的Apple用户界面指南应用

Note: I am writing a completely customized user interface for a touch screen / kiosk type app, so none of the usual Apple user interface guidelines apply.

推荐答案

用户默认为工作表的动画速度。查看它,看看如果你尝试将它设置为0会发生什么。

There is a user default for the animation speed of sheets. Look it up and see what happens if you try to set it to 0.

这篇关于如何在显示模态表时禁用Cocoa的默认动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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