Next: 1.8 How expanding flags Up: 1. Renaissance AutoLayout Previous: 1.6 Renaissance AutoLayout support

1.7 Expanding views over their minimum size

Some views display information, and once they are of the minimum size required to display the information, making them bigger does not show any more information. A typical example is a fixed text label, or a button with written 'Cancel', or a button with an image of fixed size. If all the window were made of such views, once the window is laid out, there would be no reason to make the window resizable. All the information is displayed comfortably on the window in the minimum size, and more space on the window would help in no way, except mess up the layout.

Other views display information, but if they are made bigger, they benefit from it and can use the new space to display more information. A typical example is an editable text field, where the user can insert a string of arbitrary length. When the window is automatically created, the text field is of some arbitrary, predermined, length. If the user needs to insert more text than the text field can accomodate at its default size, the user might want to enlarge the text field. This is normally achieved by making the window resizable, and setting up the autolayout in such a way that if the user makes the window bigger, the text field is automatically made bigger.

Finally, often enough sizing a view to its minimum size is enough to display the information in the view, but it looks pretty ugly in the context of the other views. This is true even for views which are naturally and inherently unresizable; for example, in panels it's common to display the 'OK' and the 'Cancel' button at the bottom, with the same size. Even if the minimum size of the 'OK' and of the 'Cancel' button are different and they are never supposed to be resized when the window is later resized, it's more aestethically pleasant to make them of the same size.

In other cases, views which look nice at their minimum size might still require alignment to fit nicely in the rest of the window. If more space is available, while they are not resized themselves, they might need the space to be spread intelligently around in order to be moved into the right position.

Finally, some views do look nice at their minimum size, but it might be graphically nice to expand them when the window is expanded over the minimum size, to keep them in a pleasant relationship with the other views.


Next: 1.8 How expanding flags Up: 1. Renaissance AutoLayout Previous: 1.6 Renaissance AutoLayout support
2008-03-19