Keywords: manual

Next: 1.3 The basics of Up: 1. Renaissance AutoLayout Previous: 1.1 What is the

# 1.2 Why using the Renaissance AutoLayout support?

The Renaissance AutoLayout package provides many advantages over hard-coding the size and position of objects at compile time (as it is done traditionally in NeXTstep NIB files):

1. the package can automatically adjust the layout for the different sizes of objects on different platforms or under different themes: objects such as popup buttons have different sizes on GNUstep and on Apple Mac OS X, so hardcoding the size and position of popup buttons creates user interfaces which are not portable between the two systems: a popup button which is perfectly sized on Apple Mac OS X might be too tiny on GNUstep, and vice versa; as a matter of fact, traditionally, you need to write separate user interfaces, with hardcoded different sizes and positions, for the different systems.
2. the package can automatically adjust the layout for the different sizes of objects when the strings displayed in the objects are translated into another language. Objects such as buttons, if sized for the string in the original language, might be too small (or too big) to display the string when translated into another language. This is a basic problem of NIB files: if you use NIB files, you need to create a separate NIB file for each language in which you want to translate the user interface.
3. the package can automatically adjust the layout if objects are added or removed from the window.
4. the package can automatically setup intelligent autorelayout behaviour of the objects, with minimum manual intervention from the programmer. Too much software has windows with inconsistent, inaccurate or even meaningless behaviour under resizing. The reason is that checking and testing all the autoresizing flags and masks and setup is a boring and stupid task, which most programmers would happily avoid doing. Renaissance AutoLayout will do it for you whenever you are in a hurry; of course, you can still override manually any of Renaissance's choices about autolayout whenever you need, and you will probably need to give Renaissance a few simple align hints (center, left, right) to make complex windows pretty.

In comparison with other similar packages available for other toolkits, Renaissance is at its best when dealing with ``standard'' windows. Other toolkits usually provide you with tons of options for the layout of each widget (or set of widgets), and you actually need to understand and set a lot of those options (border, padding, expand, fill, pack ...) just to get a standard window to layout correctly. Programmers then have to continuously lookup in reference manuals the meaning of most options, and they often enough forget to set some of the options, ending up with software where the logic of the software works, but widgets are laid out with slightly irregulars or inconsistent layouts, often with irregular and inconsistent borders or alignments or autolayout behaviours.

At a more accurate examination, it is found out that most windows of most software are actually similar and display very similar layout patterns, and that there is a precise, mechanical logic which can be used to get most autolayout options right. Renaissance does its best to use logic and intelligence to get the autolayout options right for you, freeing you from the burden of setting manually all the autolayout options, and allowing you to build a better interface for your software, and much faster.

Next: 1.3 The basics of Up: 1. Renaissance AutoLayout Previous: 1.1 What is the