我怎样才能显示一个模式表时,可以禁用Cocoa的默认的动画? [英] How can I disable Cocoa's default animation when displaying a modal sheet?

查看:109
本文介绍了我怎样才能显示一个模式表时,可以禁用Cocoa的默认的动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用可可显示模式时,板进行动画。

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

苹果公司<一href=\"http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Sheets/Concepts/AboutSheets.html#//apple_ref/doc/uid/20001043-BABFIBIA\"相对=nofollow>表编程指南状态:

...等板材的行为,如动画当它出现,​​被罚下场,是由应用程序套件自动处理。

... 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.

注意:我写了一个触摸屏/亭类型的应用程序完全自定义的用户界面,所以没有平常苹果的用户界面指导原则适用

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天全站免登陆