Rectangle class simply creates empty objects that are freely resizable. This might not seem very useful at first but in fact, rectangle objects are needed very often to fine-tune the GUI layout. They can be used for all kinds of layout magic, e.g. for controlling the alignment of fixed-size widgets and much more.
Additionally, rectangle objects are often necessary as padding
space next to objects which are not resizable themselves.
<radio> object, for instance, is not resizable. To
prevent these static radio objects from blocking the
resizing feature of your whole GUI, you can simply pad
<rectangle> objects. Here is an
example of a radio object, padded using an invisible rectangle:
<hgroup> <rectangle/> <radio id="printer"> <item>HP Deskjet</item> <item>NEC P6</item> <item>Okimate 20</item> </radio> <rectangle/> </hgroup>
By using rectangles on both sides of the radio box object, the radio box will automatically be centered inside the available GUI space. If you used only one rectangle object before the radio object, the radio object would automatically be right aligned. A rectangle object after the radio object would lead to left alignment of the radio object.
If you need fixed size padding objects, use HSpace class or VSpace class. See HSpace class for details. See VSpace class for details.
Rectangle class doesn't define any attributes.