[comp.windows.x] Get text from a text widget

coltoff@PRC.Unisys.COM (Joel Coltoff) (09/17/88)

I'm trying to get text from a text widget. i.e. the user enters
his text and then the application needs to do something with it.
Is there an X function to do this or do I just do a strcpy() or
whatever from my char *? The text widget is in a popup and I want
to zap the text when I pop down the widget. I'm doing the following.


	rtext.firstPos = 0;
	rtext.length = 0;
	rtext.ptr = NULL;
	XtTextReplace( w, 0, strlen(p), &rtext);
	XtSetArg(arglist[0], XtNsensitive, False);
	XtSetArg(arglist[1], XtNinsertPosition, 0);
	XtSetValues(w, arglist, TWO );
	errorResponse = 0;
	XtPopdown(error_popup);
	errorPopupFlag = False;

As it stands now the code dumps core on the next event after the widget is
popped down. If I comment out the XtTextReplace() everything works fine.
Any comments on this? Thanks in advance.
-- 
	- Joel
		{psuvax1,sdcrdcf}!burdvax!coltoff	(UUCP)
		coltoff@burdvax.prc.unisys.com		(ARPA)