NAME
Label widget − widget to display a non-editable string.
SYNOPSIS
Public Headers:<X11/StringDefs.h> <X11/Xaw/Label.h>
Private Header:<X11/Xaw/LabelP.h>
Class Name:Label
Class Pointer:labelWidgetClass
Instantiation:widget = XtCreateWidget(name, labelWidgetClass, ...)
CLASS HIERARCHY
Core → Simple → Label
DESCRIPTION
A Label is a non-editable text string or pixmap that is displayed within a window. The string may contain multiple lines of Latin1 characters. It can be aligned to the left, right, or center of its window. A Label can be neither selected nor directly edited by the user.
RESOURCES
When creating a Label widget instance, the following resources are retrieved from the argument list or from the resource database:
| Name (XtN...) | Type | Default | Description | |||
| XtNaccelerators | AcceleratorTable | NULL | List of event-to-action bindings to be executed by this widget, even though the event occurred in another widget. | |||
| XtNancestor− Sensitive |
Boolean | True | (D) Sensitivity state of the ancestors of this widget: a widget is insensitive if either it or any of its ancestors is insensitive. | |||
| XtNbackground | Pixel | XtDefault− Background |
Window background color. | |||
| XtNbackground− Pixmap |
Pixmap | XtUnspecified− Pixmap |
Window background pixmap. | |||
| XtNbitmap | Pixmap | None | Pixmap to display in place of the label. | |||
| XtNborderColor | Pixel | XtDefault− Foreground |
Window border color. | |||
| XtNborderPixmap | Pixmap | XtUnspecified− Pixmap |
Window border pixmap. | |||
| XtNborderWidth | Dimension | 1 | Border width in pixels. | |||
| XtNcolormap | Colormap | Parent’s colormap. | Colormap that this widget will use. | |||
| XtNcursor | Cursor | None | Pointer cursor. | |||
| XtNdepth | int | Parent’s depth. | (C) Depth of this widget’s window. | |||
| XtNdestroy− Callback |
XtCallbackList | NULL | Callbacks for XtDestroyWidget(). | |||
| (R5) XtNencoding | unsigned char | XawTextEncoding8bit | For I18N. | |||
| XtNfont | XFontStruct∗ | XtDefaultFont | Label font. | |||
| XtNforeground | Pixel | XtDefault− Foreground |
Foreground color. | |||
| XtNheight | Dimension | Font height + 2 ∗ XtNinternalHeight |
(A) Height of widget. | |||
| XtNinsensitive− Border |
Pixmap | Gray pixmap. | Border when not sensitive. | |||
| XtNinternal− Height |
Dimension | 2 | See note. | |||
| XtNinternalWidth | Dimension | 4 | See note. | |||
| XtNjustify | XtJustify | XtJustifyCenter | Type of text alignment. | |||
| XtNlabel | String | Name of widget. | String to be displayed. | |||
| (R5) XtNleftBitmap | Bitmap | None | Pixmap before label. | |||
| XtNmappedWhen− Managed |
Boolean | TRUE | Whether XtMapWidget() is automatic. | |||
| XtNresize | Boolean | TRUE | Whether to auto-resize in SetValues. | |||
| XtNscreen | Screen | Parent’s screen. | (R) Screen on which this widget is displayed: this is not a settable resource. | |||
| XtNsensitive | Boolean | TRUE | Whether widget receives input. | |||
| XtNtranslations | Translation− Table |
See below. | Event-to-action translations. | |||
| XtNwidth | Dimension | XtNlabel width +2 ∗ XtNinternalWidth | (A) Width of widget. | |||
| XtNx | Position | 0 | x coordinate in pixels. | |||
| XtNy | Position | 0 | y coordinate in pixels. | |||
Note that the Label widget supports only the XtNdestroyCallback callback list.
The new resources associated with Label are:
XtNbitmap
Specifies a bitmap to display in place of the text label. The bitmap can be specified as a string in the resource database. The StringToPixmap converter will interpret the string as the name of a file in the bitmap utility format that is to be loaded into a pixmap. The string can be an absolute or a relative filename. If a relative filename is used, the directory specified by the resource name bitmapFilePath or the resource class BitmapFilePath is added to the beginning of the specified filename. If the bitmapFilePath resource is not defined, the default directory on a POSIX-based system is /usr/include/X11/bitmaps.
XtNencoding
Specifies whether the widget uses 8-bit or 16-bit text functions. New in R5.
XtNinternalHeight
Represents the distance in pixels between the top and bottom of the label text or bitmap and the horizontal edges of the Label widget.
XtNinternalWidth
Represents the distance in pixels between the ends of the label text or bitmap and the vertical edges of the Label widget.
XtNjustify
Specifies left, center, or right alignment of the label string within the Label widget. If it is specified within an ArgList, one of the values XtJustifyLeft, XtJustifyCenter, or XtJustifyRight can be specified. In a resource of type string, one of the values left, center, or right can be specified.
XtNlabel
Specifies the text string that is to be displayed in the button if no bitmap is specified. The default is the widget name of the Label widget.
XtNleftBitmap
Specifies a name of a bitmap to display in the left margin of the Label. All 1’s in the bitmap are rendered in the foreground color, and all 0’s will be drawn in the background color. New in R5.
XtNresize
Specifies whether the Label widget should attempt to resize to its preferred dimensions whenever XtSetValues() is called for it.