我想为xulrunner应用程序的主窗口设置最小大小。我已经尝试过minwidth和minheight但是没有工作。我错过了吗?

有帮助吗?

解决方案 3

保持xul窗口最小大小的脏方法,以侦听resize事件并使用window.resizeTo()

其他提示

以下是一个例子:

window.addEventListener("resize", function() {
    if(window.outerWidth > 100 && window.outerHeight > 100 &&
       (window.outerWidth < window.document.documentElement.minWidth ||
        window.outerHeight < window.document.documentElement.minHeight)) {

        window.resizeTo(
            window.document.documentElement.minWidth,
            window.document.documentElement.minHeight            
        );
    }
}, false);

这假设您在XUL窗口标记上设置了 minwidth minheight 属性。

&gt;在我的情况下,在加载过程中窗口大小为1或23,需要进行100次检查,并在加载过程中多次调整大小。

不,你不能。

如果你不相信我,请尝试使用firefox - 它可以调整大小到标题栏。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top