The constrainSize combinator is a simple way of controlling the size and placement of a component within a container:
constrainSize :: (Size -> Rectangle -> Rectangle) -> DisplayHandle -> DisplayHandle