Path: utzoo!attcan!uunet!mcvax!ukc!eagle!rlh2 From: rlh2@eagle.ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: Re: Athena text widgets Message-ID: <5397@eagle.ukc.ac.uk> Date: 22 Jul 88 10:25:10 GMT References: <6190@bloom-beacon.MIT.EDU> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Followup-To: comp.windows.x Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 19 In article <6190@bloom-beacon.MIT.EDU> dschmidt@athena.mit.edu (Dan Schmidt) writes: >I'm using the Athena widgets in an X application, and I'm having some trouble >with the text widget. I would like to display some text in the widget, and >subsequently change the text from time to time. It doesn't like it when >I try to change XtNstring, and if I directly change the string that >XtNstring refers to, nothing happens. Does anyone know the right thing >to do? > I use this work-around but surely there is a better way? String newtext; /* the new text to replace existing text */ Widget dialog; /* the text widget (I use asciiStringWidgetClass) */ XtSetArg(args[i], XtNstring, newtext); i++; XtStringSourceDestroy(XtTextGetSource(dialog)); XtTextSetSource(dialog, XtStringSourceCreate(XtParent(dialog), (ArgList)args, i), 0); Richard