[comp.windows.x] Adding text to R3 Athena Text widget

hanson@tramp.Colorado.EDU (HANSON JEFFREY ALLAN) (11/27/90)

Sorry if this is a repost but I don't think my original post left our sight.


I have been wrestling with an Athena text widget problem for the past few 
days and have decided to turn to the net for help. Here is my problem:

When I try to add text to an asciiStringWidget (X11R3) using XtTextReplace
all I get is garbage like (^@^@^@^L... ) and XtTextReplace returns 
a 1 ( XawEditError ). Well I have tried fiddling with resources and 
different values for the XtTextReplace parameters but always have this
same result. I am using Wcl and the string specified for the string 
resource appears as it should but any text added using XtTextReplace appears
as garbage. Here are the particulars of my system:

OS:  ISC ver 2.2
     X11 development package ver 1.2 (X11R3)
     Compaq 386/20 with VGA monitor and card.

and here is the code I am using to add text:

	Widget w;
	XtTextPosition pos,endpos;
	XtTextBlock text;
	int     result;

	pos = XtTextGetInsertionPoint(w);
	text.firstPos = 0;
	text.length = strlen(msg);
	text.ptr = msg;
	text.format = FMT8BIT;            /* the manual says use this value */
	endpos = pos + strlen(msg);
	result = XtTextReplace(w, pos, pos , &text);
	XtTextSetLastPos(w, endpos);
	XtTextSetInsertionPoint(w,endpos);

Am I missing something subtle or obvious? 

NOTE: I have check my ISC release notes and found nothing pertaining to this,
also I have checked msg to be sure it contains the string I think it does.

thanks in advance
Jeff Hanson
hanson@tramp.colorado.edu