Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!uunet!husc6!endor!kochhar From: kochhar@endor.harvard.edu (Sandeep Kochhar) Newsgroups: comp.windows.x Subject: DialogWidget problems... Message-ID: <2433@husc6.harvard.edu> Date: 14 Aug 89 04:45:43 GMT Sender: news@husc6.harvard.edu Reply-To: kochhar@endor.harvard.edu (Sandeep Kochhar) Distribution: usa Organization: Aiken Computation Lab Harvard, Cambridge, MA Lines: 45 (I'm sorry to use the net for this, but I lost the original mail and the person's address). Recently someone else had mentioned the fact that XtDialogGetValueString didn't produce the right result, (after an XtSetValues call on XtNvalue). Here's a simple fix to the file Dialog.c to solve the problem; basically, the original Dialog Widget ignored XtSetValues on the value string. I just added it, and everything seems to work fine. ----------------- cut here -------------------- *** /tmp/Dialog.c Mon Aug 14 00:51:12 1989 --- ./Dialog.c Sat Aug 12 19:48:24 1989 *************** *** 229,234 **** --- 229,247 ---- XtSetValues( w->dialog.labelW, args, XtNumber(args) ); } + if (w->dialog.value != old->dialog.value + || (w->dialog.value != NULL + && old->dialog.value != NULL + && strcmp(w->dialog.value, old->dialog.value)) + ) + { + strcpy(old->dialog.value, w->dialog.value); + w->dialog.value = old->dialog.value; + XtTextSetLastPos(w->dialog.valueW, strlen(w->dialog.value)); + XtTextSetInsertionPoint(w->dialog.valueW, 0); + XtTextDisplay(w->dialog.valueW); + } + return False; } ----------------- cut here -------------------- Sandeep Kochhar (617) 495-9515 mail: kochhar@harvard.harvard.edu Harvard University kochhar@harvard.csnet 33 Oxford st, kochhar@harvard.uucp Cambridge, Ma 02138 kochhar@harvard.bitnet "If you didn't get this message, please let me know."