23.1 Overview

Label class can be used to conveniently create labels for your widgets. Labels typically contain an underscore character to indicate the shortcut for accessing the widget that a label describes.

Here is an example of how to use the <label> command:

 
<hgroup>
    <label>_Name</label>
    <textentry/>
</hgroup>

The code above sets up a text entry widget that is labelled "Name". It also sets up a shortcut: When the user presses ALT+N, the text entry widget is automatically activated. See Keyboard shortcuts for details.

Please note that labels are not resizable horizontally. That is why they can easily block resizing of your whole GUI. To circumvent this problem, you can simply put the label in a <hgroup> together with an empty <rectangle> object. See Rectangle class for details.


Show TOC