如何以最快的方式显示窗口?
我的 Xulrunner 应用程序中有 3 个主窗口,访问频率非常高。该应用程序在一个非常慢的系统上运行,因此在窗口显示之前,我看到一个完全黑框,然后窗口出现,填充该黑色区域。
由于我在嵌入式系统中,并且未显示“最小化”动画,因此我将窗口最小化而不是关闭,但它仍然没有按照我想要的速度显示。
有没有办法让窗口加载到缓冲区中,以便它更快地显示?或者,我怎样才能以最快的方式显示这个窗口?
--更新
顺便说一句,窗户没有什么重的。一个是带有“正在加载”标签的弹出窗口,我仍然需要很长时间(大约一秒钟)才能显示:
<?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');
I have 3 main windows in my Xulrunner app that will be accessed very frequently. The application is running on a very slow system, so before the window shows up, I see a fully black box, and then the window appears, filling that black area.
As I'm in an embedded system, and the "minimize" animation is not shown, I did the window's minimize instead of closing, but it's still not showing up as fast as I wanted.
Is there a way to let a window load in a buffer so that it appears more quickly? Or, how can I display this window in the fastest way possible?
--update
By the way, the windows have nothing heavy. One is a popup window with a "Loading" label, and I it still takes much time (about a second) to show up:
<?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>
I open it with:
openDialog("chrome://myapp/content/loading.xul", 'Loading', 'chrome, popup, centerscreen');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不能简单地交换主窗口中的所有元素并将它们替换为您想要显示的窗口的元素吗?或者,可能更好的是,使用 deck 做类似的事情?
can't you simply swap out all elements from the main window and replace them with the elements of the window you want to show? or, probably better yet, doing something similar with a deck?
我不确定这是否是您想要的,但可以暂时隐藏一个窗口,以便在您需要时可以再次显示它。请参阅 nsMsgComposeService::ShowCachedComposeWindow 了解总体思路。
I'm not sure that this is what you want, but it's possible to temporarily hide a window so that when you want it you can simply show it again. See nsMsgComposeService::ShowCachedComposeWindow for the general idea.
你能做本地代码吗?
createHiddenWindow()
或者,您可以使用创建一个隐藏镶边的微小透明窗口
这并不完整,但对于初学者来说:
can you do native code?
createHiddenWindow()
alternatively, you could toy with creating a tiny, transparent window with the chrome hidden
It's not complete but for starters: