[comp.windows.x] Help needed with Xt and Text widgets

slf@mel.dit.csiro.au (Stewart Forster) (01/03/91)

Hi,
	I am writing an application in Xt that requires the use of
specially formatted textual output. I am posting this for suggestions.

	The format consists of many lines of text, each line consists
of two independant strings which both may be of arbitrary length. Now
I want to be able to edit strings in this format plus have the ability
to allow a horizontal scrollbar for use by the user, in the case of
window overflow.

	I have tried hacking around with the Athena Text widget but it
does not provide the sort of formatting control I reuquire.  I thought
of using list widgets but I am uncertain as to how these would handle
editing, as well as scrolling.  Can somebody please suggest a possible
solution using the current Athena widget set, or am I doomed to study
the intricacies of creating my own widget.  Thank you in advance,

						Stewart Forster.

swick@athena.mit.EDU (Ralph Swick) (01/03/91)

	The format consists of many lines of text, each line consists
    of two independant strings which both may be of arbitrary length.
    ...
	I have tried hacking around with the Athena Text widget but it
    does not provide the sort of formatting control I reuquire.

You might take a look at the interfaces for TextSource (TextSrc) and
TextSink.  If you want to maintain the pairs of strings as independently
addressable entities, a specialized TextSource should be able to do
what you want.  If you want special display formatting, a specialized
TextSink might do the trick.  There's an example of a *very* specialized
alternative text source in clients/xmh/tsource*.

Unfortunately, there's not a lot of written documentation on these
interfaces; use the R4 Xaw manual and the code.  No guarantees that
any of this is easier than writing your own editing widget from scratch. :-)