如何以最快的方式显示窗口

How to show a window in the fastest way possible?

本文关键字:方式 显示 窗口      更新时间:2023-09-26

我有3个主窗口在我的Xulrunner应用程序,将被访问非常频繁。应用程序在一个非常慢的系统上运行,所以在窗口显示之前,我看到一个完整的黑色框,然后窗口出现,填充黑色区域。

由于我是在嵌入式系统中,并且没有显示"最小化"动画,所以我将窗口最小化而不是关闭,但它仍然没有像我想的那样快速显示。

是否有一种方法可以让窗口加载在缓冲区中,以便它显示得更快?或者,如何以最快的方式显示此窗口?

,

顺便说一下,窗户上没有重物。一个是带有"Loading"标签的弹出窗口,如果它仍然需要很长时间(大约一秒钟)才能显示出来:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Style -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="loadingWindow" hidechrome="true"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <vbox pack="center" align="center">
        <label id="textLabel">Loading...</label>
    </vbox>
</window>

我打开它:

openDialog("chrome://myapp/content/loading.xul", 'Loading', 'chrome, popup, centerscreen');

可以做本机代码吗?
createHiddenWindow ()

或者,你可以创建一个小的,透明的窗口,chrome隐藏

不完整,但对于初学者:

<?xml version="1.0"?>
<!--<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>-->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="1px" height="1px" hidechrome="true" style="max-width:1px; max-height:1px; opacity:0">
<description>blar</description>
</window>

难道你不能简单地把主窗口中的所有元素替换为你想要显示的窗口的元素吗?或者,也许更好的是,用牌组做类似的事情?

我不确定这是否是您想要的,但是可以暂时隐藏一个窗口,以便在需要时再次显示它。请参见nsMsgComposeService::ShowCachedComposeWindow。