Hi, I want to set a minimum size for my xulrunner applications' main window.I have tried minwidth and minheight but didnt work.wat am i missing out?
A:
No, you can't.
If you don't believe me, try firefox -- it can resize to just the title bar.
J-16 SDiZ
2009-06-23 05:29:54
A:
A dirty way to keep the xul window minimum size to to listen to the resize event and use window.resizeTo()
NightCoder
2009-08-12 11:14:37
A:
Here is an example:
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);
This assumes you have the minwidth and minheight properties set on the XUL window tag.
The > 100 check is needed as the window size is 1 or 23 during loading in my case and resize fires multiple times during loading.
cadorn
2010-07-23 00:01:58