In addition to the resources discussed in the previous section, Text has many others, including the following:
In addition, Text and TextField have several resources that determine the geometry of the widget:
XmNresizeWidth is initialized to False when XmNscrollHorizontal is True or XmNwordWrap is True. XmNresizeHeight is initialized to False when XmNscrollVertical is True. Word wrap will not take effect if XmNscrollHorizontal is True.
If the user or application initializes or sets a specific height (XmNheight) or width (XmNwidth), that value is used as the corresponding dimension of the widget. In addition, if a height is specified, XmNrows is recalculated based on that height and, if a width is specified, XmNcolumns is recalculated based on that width.
If the user or application initializes or sets XmNrows but not XmNheight, the geometry calculation depends on the value of XmNresizeHeight. If XmNresizeHeight is False, as it is by default, the height of the widget is simply the height needed to display XmNrows of text. The same relations hold for XmNcolumns, XmNwidth, and XmNresizeWidth.
If the user or application does not initialize either XmNrows or XmNheight, the geometry calculation depends on the value of XmNresizeHeight. If XmNresizeHeight is True, the height of the widget is the height needed to display all the text. If XmNresizeHeight is False, the height of the widget is the height needed to display the default for XmNrows, which is one row of text. The same relations hold for XmNcolumns, XmNwidth, and XmNresizeWidth, except that the default number of columns is 20.
If the contents of the text (XmNvalue or XmNvalueWcs) change, as a result of user editing or an action by the application, the geometry calculation depends on the value of XmNresizeHeight. If XmNresizeHeight is True, the height of the widget is the height needed to display all the text. If XmNresizeHeight is False, the height of the widget does not change. The same relations hold for XmNvalue, XmNvalueWcs, XmNresizeWidth, and the width of the widget.
If the application sets another resource that affects the height needed by the widget, such as XmNmarginHeight or XmNrenderTable, the geometry calculation depends on the value of XmNresizeHeight. If XmNresizeHeight is True, the height of the widget is the height needed to display all the text with the new resource values. If XmNresizeHeight is False, the height of the widget is the height needed to display XmNrows of text by using the new resources. The same relations hold for these resources, XmNresizeWidth, XmNcolumns, and the width of the widget.
Note: | Most of the resources described in this section have other meanings when XmNlayoutDirection is XmTOP_TO_BOTTOM (for vertical writing). For example, if word-wrapping is turned on, text is broken at the end of a column and is continued at the next column. |