Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Resetting asciiStringWidgets Message-ID: <8906291428.AA02029@LYRE.MIT.EDU> Date: 29 Jun 89 14:28:47 GMT References: <8906231731.AA04586@air> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 36 Date: Fri, 23 Jun 89 12:31:54 CDT From: wjhagins@vuse.vanderbilt.edu (William J. Hagins) I have several asciiStringWidgets managed by a formWidget, and I want a loop to refresh the widgets (i.e., reset the strings to nulls). ... Can anyone offer a solution to this problem. Do this: { XtTextBlock text; XtTextPosition last; text.ptr = NULL; text.firstPos = 0; text.length = 0; text.format = FMT8BIT; last = number_of_characters_in_current_string; if (XtTextReplace(w, 0, last, &text)) { /* an error occurred */ } } If you don't know the size of the current string, here's a hack to retrieve it, given the limitations of the R3 AsciiString widget: { XtTextPosition last; XtTextSetInsertionPoint(w, 9999999); last = XtTextGetInsertionPoint(w); }