[comp.windows.x] Problems using the TextWidget

glasgow@POPEYE.NOSC.MIL (Michael Glasgow) (01/25/89)

I am having trouble with text widgets.

I am currently using the HP Widget Set that runs
under the Release 2 Toolkit, but am running an
Release 3 server.  This is running on a Sun 4/280
under Sun OS 4.0 if that is relevant.

Anyway, I can not seem to figure out how to get
text out of a text widget.  I set up the initial
string with the following code:

strcpy( string, "This is a Test." );
XtSetArg( args[nargs], XtNstring, ( XtArgVal )string );
...

Then i created the widget.  The widget came up fine, and I
assumed that the widget would store the modified string in
the char variable that I passed as a parameter.  Obviously,
this is not the case.  As I edit the string, the char array
is never changed in the array, but is altered on the screen.

How do I get the new string out of the widget?  This question
applies to not only the HP widgets, but the Athena Widgets as
well.

michael
glasgow@popeye.nosc.mil
Michael Glasgow
Tiburon Systems, Inc.
4025 Hancock St.  Suite 207
San Diego, CA 92110
(619)-581-0634

bturner@hpcvlx.HP.COM (Bill Turner) (01/26/89)

> How do I get the new string out of the widget?  This question
> applies to not only the HP widgets, but the Athena Widgets as
> well.

How about

	unsigned char *XwTextCopyBuffer(w)
	Widget w;

The buffer is allocated with XtMalloc, and the code calling is responsible
to free the buffer.

--Bill Turner