Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: Resetting asciiStringWidgets Message-ID: <8906291602.AA20024@expo.lcs.mit.edu> Date: 29 Jun 89 16:02:07 GMT References: <8906291428.AA02029@LYRE.MIT.EDU> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 45 > Can anyone offer a solution > to this problem. [ Ralph writes: ] > 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 */ > } >} 1) This will only work on EDITABLE Text Widgets, this will always return an error if the Text Widget is read only. 2) The last function call should be. if (XtTextReplace(w, 0, last, &text) != XawEditDone) { /* an error occurred */ } There is no guarantee that XawEditDone is zero, it just happens to be that way in the current implementation. For further information on this function consult the Athena Widget Documentation (pp 26). Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213