This content has been marked as final. Show 2 replies
The min widths are enforced at the initial layout. What's happening, then, is that the user is dragging the divider and destroying that arrangement. So what you want to do is prevent the user from dragging the divider left so much so that the button gets clipped?
You could do something like set the HBox's minWidth to the button's minWidth like this:
<mx:Button id="b1" label="Button 1" minHeight="20" minWidth="60" width="100%"/>
<mx:Button label="Button 2" minHeight="20" minWidth="60" width="100%"/>
Thanks - you are correct that the layout is correct when app is initially started.
I *could* hardcode the HBox width and this would work - but this would mean whenever any HBox child changed width I'd have to adjust it.....
What I don't understand is why the HBox doesn't expose it's minimum size as the minimum dictated by the sum of min sizes of contained children and the various padding (the single button in this case).
This is the normal behaviour I've seen on h/v box layouts in other UI toolkits - e.g. the C++ based, cross platform Qt http://doc.trolltech.com/4.4/layout.html
Also why does HDividedBox respect the minimum widths of it's children - but HBox doesn't?