# XmString Editor

The XmString editor is used to specify Motif compound strings. It is accessed from resource panels by clicking on the buttons on the left of the resource panel.

A Motif compound string is made up of a number of text segments interspersed with direction indicators, newline segments and font indicators.

When a compound string is displayed by Motif a FontList is used to specify the appropriate fonts. A FontList is made up of font and fontlist tag pairs. The fontlist tag is used in the compound string to indicate which particular font from the font list is to be used to display any given text segment.

To create font lists use the Font Selector dialog.

Use the drawing area in the center of the dialog to edit your compound string. There is a popup menu that you can use to insert new segments into the string.

To select a text segment, either insert a new text segment, or click on an existing segment. The selected text segment can then be edited according to requirements.

To use a specific font object - which is bound to a font list using the Font Selector dialog, type the name into the FontList field. The popup menu will then contain entries for the fontlist tags referenced in that font list.

You can see exactly what is in your compound string by setting the show symbols toggle. Direction segments are shown with arrows: Left pointing for Left to Right and Right pointing for Right to Left. Obviously direction symbols are show at the appropriate end of text segments. Where a text segment that is being displayed Left to Right is followed by a Right to Left direction segment a centered dot is used to indicate the end of the segment.

Fontlist tag changes are indicated by a small circle with a cross in the middle. Text segments that are empty are shown as a larger circle with a line across.

Segments other than text segments can be moved and copied by clicking on them with Button1 or Button2 respectively and dragging them to the new location. Fontlist tag indicators display the name of the fontlist tag while they are being dragged.

Any segment can be deleted by popping up the menu over it and selecting delete.

String objects may be regarded as global variables. They are a means of binding a string to a name (my_string). You can then specify anywhere that you can specify an XmString. The Design Window will display the appropriate string. If you change the binding then all occurrences of the string object will be updated.

To set up a string object, type the name of the object into the string object field. Use the editing area to specify the string you wish it to be bound to. Pressing the bind button associates the font with the object name and enters the name in the selection field.

Use the Apply button to set the resource value in the resource panel to the value that is displayed in the object selection field.

To use an existing string object select it from the list, type in the selection field, or type in the string field in the resource panel.

To redefine a string object, select it, edit the string and press the bind button. All occurrences of the string object will be updated in the design.

To delete a string object, select it and press the delete button. If the string object is being used you will not be allowed to delete it.

See also:

- Font Selector dialog
- About WorkShop Visual