(3)

NAME
Mlabel

DESCRIPTION
The Label class has the capability to display one or more lines of text in a single font. Otherwise it is the same as the Board class. The text can be left, right or center justified and it can be centered vertically or put against the top or the bottom of the widget. There is also a resource to set tab stops. There are two ways of highlighting portions of the label: reversing the colors or changing the foreground. Both methods can be combined, though the result when both highlighting methods are applied to the same part of the text is undefined.

  Public variables
Mlabel
Name | Class | Type | Default
XtNlabel | XtCLabel | String | NULL
XtNfont | XtCFont | FontStruct | XtDefaultFont
XtNforeground | XtCForeground | Pixel | XtDefaultForeground
XtNhlForeground | XtCHlForeground | Pixel | XtDefaultForeground
XtNalignment | XtCAlignment | Alignment | 0
XtNtopMargin | XtCTopMargin | Dimension | 2
XtNbottomMargin | XtCBottomMargin | Dimension | 2
XtNleftMargin | XtCLeftMargin | Dimension | 2
XtNrightMargin | XtCRightMargin | Dimension | 2
XtNshrinkToFit | XtCShrinkToFit | Boolean | False
XtNrvStart | XtCRvStart | int | 0
XtNrvLength | XtCRvLength | int | 0
XtNhlStart | XtCHlStart | int | 0
XtNhlLength | XtCHlLength | int | 0

XtNlabel
    The text is a single string, which may contain embedded newlines. There is no provision for changing fonts in the middle of a text.

XtNfont
    The text is drawn in the font which is given as the font resource.

XtNforeground
    The foreground color is the color used to draw the text. hlForeground is the foreground for highlighted text.

XtNhlForeground

XtNalignment
    The text can be aligned in the widget in nine ways: left, right or center, combined with top, center or bottom. Symbolic constants XfwfTop, XfwfBottom, XfwfLeft and XfwfRight can be added together to get the desired alignment. The alignment is actually a four-bit number made up of two parts of 2 bits added together: 1 is left, 2 is right, 0 is center, 4 is top, 8 is bottom, 0 is vertical center. Thus 5 (= 1 + 4) means top left and 2 (= 2 + 0) means center right. For easier specification, there is also a converter from strings, that accepts string like `top left' or `center right'.

XtNtopMargin
    The topmargin is only used when the text is not centered. It gives the number of pixels between the frame and the top of the text.

XtNbottomMargin
    The bottomMargin is only used to compute the preferred size of the button in case shrinkToFit = True.

XtNleftMargin
    The leftMargin is only used when the text is not centered. It gives the number of pixels between the frame and the left edge of the text, and if possible also between the frame and the right edge of the text.

XtNrightMargin
    The rightMargin is only used to compute the preferred size of the button in case shrinkToFit = True.

XtNshrinkToFit
    Buttons will normally not occupy the full area of their parents. Most likely they will be a fixed size or a size depending on the label. By setting the shrinkToFit resource to True, the width and height are recomputed with every new label.

XtNrvStart
    It is possible to set a part of the label apart by drawing it in reverse. The rvStart resource gives the index of the first character to draw in reverse video.

XtNrvLength
    The rvLength resource contains the number of characters to draw in reverse video.

XtNhlStart
    The start and length of the highlighted portion are set with the resources hlStart and hlLength.

XtNhlLength
    Composite
    Name | Class | Type | Default
    XtNchildren | XtCChildren | WidgetList | NULL
    insertPosition | XtCInsertPosition | XTOrderProc | NULL
    numChildren | XtCNumChildren | Cardinal | 0
    Core
    Name | Class | Type | Default
    XtNx | XtCX | Position | 0
    XtNy | XtCY | Position | 0
    XtNwidth | XtCWidth | Dimension | 0
    XtNheight | XtCHeight | Dimension | 0
    borderWidth | XtCBorderWidth | Dimension | 0
    XtNcolormap | XtCColormap | Colormap | NULL
    XtNdepth | XtCDepth | Int | 0
    destroyCallback | XtCDestroyCallback | XTCallbackList | NULL
    XtNsensitive | XtCSensitive | Boolean | True
    XtNtm | XtCTm | XTTMRec | NULL
    ancestorSensitive | XtCAncestorSensitive | Boolean | False
    accelerators | XtCAccelerators | XTTranslations | NULL
    borderColor | XtCBorderColor | Pixel | 0
    borderPixmap | XtCBorderPixmap | Pixmap | NULL
    background | XtCBackground | Pixel | 0
    backgroundPixmap | XtCBackgroundPixmap | Pixmap | NULL
    mappedWhenManaged | XtCMappedWhenManaged | Boolean | True
    XtNscreen | XtCScreen | Screen * | NULL

  Exports
The type Alignment is actually an integer, but it is given a different name to allow a type converter to be installed for it.

type
 Alignment = int
The symbolic constants can be added together to form an alignment. Various widgets use this to position labels, other widgets, etcetera.

def XfwfCenter = 0 def XfwfLeft = 1 def XfwfRight = 2 def XfwfTop = 4 def XfwfBottom = 8