Amiga Unix — 68040 · 68060

Manual pages › Libraries: curses, OPEN LOOK and others (3)

olStaticText(3)

StaticText

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

WIDGET CLASS NAME · SYNOPSIS · DESCRIPTION · RESOURCES

WIDGET CLASS NAME

StaticText

SYNOPSIS

#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <StaticText.h>
widget = XtCreateWidget(name, staticTextWidgetClass, ...);

DESCRIPTION

The StaticText widget provides a way to present an uneditable block of text using a few simple layout controls.

Word Wrapping If the text is too long to fit in the width provided by the StaticText widget, the text may be "wrapped" if the application requests it. The wrapping occurs at a space between words, if possible, leaving as many words on a line as will fit. If a word is too long for the width, it is wrapped between characters. An embedded newline will always cause a wrap.

Text Clipping-In Width If the text is not wrapped, it will be truncated if it cannot fit in the width of the StaticText widget. The application can choose whether the truncation occurs on the left, right, or evenly on both sides of each line of the text.

Text Clipping-In Height If the text is too large to fit in the height provided by the StaticText widget, the text is clipped on the bottom. The clipping falls on a pixel boundary, not between lines, so that it is possible that only the upper part of the last line of text may be visible.

Stripping of Spaces The application can choose to have leading spaces, trailing spaces, or both leading and trailing space stripped from the text before display, or can choose to have no stripping done.

Selecting and Operating on the Text The StaticText widget allows text to be selected in several ways and then copied. See Text Selection earlier in this manual for the description of these operations.

StaticText Coloration Figure 1 illustrates the resources that affect the coloration of the StaticText widget.

Figure 1.  Static Text Coloration

RESOURCES

 ____________________________________________________________________________________
|______________________________StaticText_Resource_Set______________________________|
| Name                |  Class         |  Type          |  Default         |  Access|
|_____________________|________________|________________|__________________|________|
| XtNalignment        |  XtCAlignment  |  OlDefine      |  OL_LEFT         |  SGI   |
|_____________________|________________|________________|__________________|________|
|_XtNancestorSensitive|__XtCSenstitive_|__Boolean_______|__TRUE____________|__G*____|
| XtNbackground       |  XtCBackground |  Pixel         |  White           |  SGI-  |
|_____________________|________________|________________|__________________|________|
|_XtNbackgroundPixmap_|__XtCPixmap_____|__Pixmap________|__(none)__________|__SGI-__|
| XtNborderColor      |  XtCBorderColor|  Pixel         |  Black           |  SGI-  |
|_____________________|________________|________________|__________________|________|
|_XtNborderPixmap_____|__XtCPixmap_____|__Pixmap________|__(none)__________|__SGI-__|
| XtNborderWidth      |  XtCBorderWidth|  Dimension     |  0               |  SGI   |
|_____________________|________________|________________|__________________|________|
|_XtNdepth____________|__XtCDepth______|__int___________|__(parent's)______|__GI____|
| XtNdestroyCallback  |  XtCCallback   |  XtCallbackList|  NULL            |  SI    |
|_____________________|________________|________________|__________________|________|
|_XtNfont_____________|__XtCFont_______|__XFontStruct_*_|__(OPEN_LOOK_font)|__SI____|
| XtNfontColor        |  XtCFontColor  |  Pixel         |  (see below)     |  SGI   |
|_____________________|________________|________________|__________________|________|
|_XtNforeground_______|__XtCForeground_|__Pixel_________|__Black___________|__SGI-__|

 _________________________________________________________________________________
|_________________________StaticText_Resource_Set_(cont.)________________________|
| Name                |  Class               |  Type     |  Default     |  Access|
|_____________________|______________________|___________|______________|________|
| XtNgravity          |  XtCGravity          |  OlDefine |  WestGravity |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNheight___________|__XtCHeight___________|__OlDefine_|__(calculated)|__SGI___|
| XtNlineSpace        |  XtCLineSpace        |  int      |  0           |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNmappedWhenManaged|__XtCMappedWhenManaged|__Boolean__|__TRUE________|__SGI___|
| XtNrecomputeSize    |  XtCRecomputeSize    |  Boolean  |  TRUE        |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNsensitive________|__XtCSensitive________|__Boolean__|__TRUE________|__GI*___|
| XtNstring           |  XtCString           |  String   |  NULL        |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNstrip____________|__XtCStrip____________|__Boolean__|__TRUE________|__SGI___|
| XtNuserData         |  XtCUserData         |  XtPointer|  NULL        |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNwidth____________|__XtCWidth____________|__Dimension|__(calculated)|__SGI___|
| XtNwrap             |  XtCWrap             |  Boolean  |  TRUE        |  SGI   |
|_____________________|______________________|___________|______________|________|
|_XtNx________________|__XtCPosition_________|__Position_|__0___________|__SGI___|
| XtNy                |  XtCPosition         |  Position |  0           |  SGI   |
|_____________________|______________________|___________|______________|________|
 XtNalignment

 Range of Values:
      OL_LEFT/"left"
      OL_CENTER/"center"
      OL_RIGHT/"right"

This specifies the alignment to be applied when drawing the text, as described below:

OL_LEFT causes the left sides of the lines to be vertically aligned;

OL_CENTER causes the centers of the lines to be vertically aligned;

OL_RIGHT causes the right sides of the lines to be vertically aligned.

                 XtNfont

     Range of Values:
          (any valid return from XLoadQueryFont())
Default:
     (chosen to match the scale and screen resolution)

This resource identifies the font to be used to display the text. The default value points to a cached font structure; an application should not expect to get this value with a call to XtGetValues() and use it reliably thereafter.

XtNfontColor

Range of Values:

(any Pixel value valid for the current display)/(any name from the rgb.txt file)

Default:

     value of XtNforeground

This resource specifies the color for the font. If not set, the color from the XtNforeground resource, if available, is used for the font.

See the note about the interaction of this resource with other color resources under the description of the XtNbackground resource in CORE(3W).

XtNforeground This resource defines the foreground color for the widget. See the note about the interaction of this resource with other color resources under the description of the XtNbackground resource in CORE(3W).

XtNgravity

Range of Values:
     CenterGravity
     NorthGravity
     SouthGravity
     EastGravity
     WestGravity
     NorthWestGravity
     NorthEastGravity
     SouthWestGravity
     SouthEastGravity

The application can set a width and height to the StaticText widget that exceeds the size needed to display the string. This resource controls the use of any extra space with the StaticText widget:

CenterGravity

The string is centered vertically and horizontally in the extra space.

North The top edge of the string is aligned with the top edge of the space and centered horizontally.

South The bottom edge of the string is aligned with the bottom edge of the space and centered horizontally.

East The right edge of the string is aligned with the right edge of the space and centered vertically.

West The left edge of the string is aligned with the left edge of the space and centered vertically.

NorthWest

The top and left edges of the string are aligned with the top and left edges of the space.

NorthEast

The top and right edges of the string are aligned with the top and right edges of the space.

SouthWest

The bottom and left edges of the string are aligned with the bottom and left edges of the space.

SouthEast

The bottom and right edges of the string are aligned with the bottom and right edges of the space.

        XtNlineSpace

Range of Values:

     -100 < XtNlineSpace

This resource controls the amount of space between lines  of
text.   It  is specified as a percentage of the font height,
and is the distance between the baseline of  one  text  line
and  the  top  of  the  next  font line.  Thus, the distance
between successive text baselines, in percentage of the font
height, is
                      XtNlineSpace+100

XtNrecomputeSize

Range of Values:
     TRUE
     FALSE

This resource indicates whether the StaticText widget should calculate its size and automatically set the XtNheight and XtNwidth resources. If set to TRUE, the StaticText widget will do normal size calculations that may cause its geometry to change. If set to FALSE, the StaticText widget will leave its size alone; this may cause truncation of the visible image being shown by the StaticText widget if the fixed size is too small, or may cause centering if the fixed size is too large.

XtNstring This resource is the string that  will  be  drawn.

The string must be null terminated.

     XtNstrip

     Range of Values:
          TRUE
          FALSE
     This resource controls the stripping of leading and trailing
     spaces during the layout of the text string.
______________________________________________________________________
|XtNstrip|__XtNalignment|__Spaces_stripped___________________________|
|        |  OL_LEFT     |  Leading spaces stripped.                  |
|        | _____________|____________________________________________|
|TRUE    | _____________|__Trailing_spaces_stripped._________________|
|        |  OL_CENTER   |  Both leading and trailing spaces stripped.|
|________|______________|____________________________________________|
|FALSE___|__(any)_______|__None._____________________________________|

     XtNwrap

     Range of Values:
          TRUE
          FALSE

     This resource controls the wrapping of lines  that  are  too
     long to fit in the width of the StaticText widget.
_______________________________________________________________________
|XtNwrap|__XtNalignment|__Wrap_action_________________________________|
|       |  OL_LEFT     |  Clipped on the right                        |
|       | _____________|______________________________________________|
|FALSE  | _____________|__Clipped_on_the_left_________________________|
|       |  OL_CENTER   |  Clipped equally on both left and right      |
|_______|______________|______________________________________________|
|       |              |  Long text is broken at spaces between words |
|TRUE   |  (any)       |  so that each line of the displayed text has |
|_______|______________|__as_many_words_as_can_fit.___________________|