PDA

View Full Version : Window resizing by its child components



g2mac
12 Aug 2009, 6:54 AM
Hi!
I need to resize my Window accordingly with new size of its child component (Panel for example, window layout == fit) How can I do that? I can get panel.getWith() and panel.getHeight(), but how can I calculate new size of parent Window(with borders,toolbars and so on)? When I do panel.setSize() my Window don't resize automatically and win.syncSize() and win.doLayout() don't work.

g2mac
12 Aug 2009, 7:17 AM
Problem was solved:
var wOffset = win.getWidth()-win.getInnerWidth();
win.setWidth(panel.getWidth()+wOffset);

Don't be in a hurry.

Animal
12 Aug 2009, 7:38 AM
Problem was solved:
var wOffset = win.getWidth()-win.getInnerWidth();
win.setWidth(panel.getWidth()+wOffset);

Don't be in a hurry.

Why use a sizing layout? layout: 'fit' sets the.... well, I'm sure you know what it does, or can find out easily.