Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!ukc!acorn!steve From: steve@acorn.co.uk (Steve "Daffy" Hunt) Newsgroups: comp.windows.x Subject: xclipboard bug? Keywords: xclipboard, bug, fix Message-ID: <769@acorn.co.uk> Date: 14 May 89 13:23:24 GMT Reply-To: steve@acorn.UUCP (Steve "Daffy" Hunt) Organization: Acorn Computers Ltd, Cambridge, England Lines: 71 System1: X11R3 with patches 1-9. Acorn X11R2 server, 4.3bsd. System2: X11R3. Sun 3/60C X11R3 server, SunOS 3.5EXPORT. The XClipboard client seems to rely on undocumented behaviour of the Form widget. When specifying the children of the form it does not bother to give XtNfrom{Horiz,Vert} arguments. According to the documentation, that means that all the child widgets should be superimposed on top of each other. And they are! (System1). Except on my Sun (System2)... when they are layed out as intended! I have squinted briefly at the code in Form.c and I did not see anything to make me think this is not a bug. Why it should "work" on the Sun, I have not the time to explore. But here is a fix for xclipboard.c to make it behave. Steve Hunt. *** /tmp/,SMSt1012596 Thu Feb 23 14:50:12 1989 --- xclipboard.c Sun May 14 13:57:15 1989 *************** *** 192,202 **** --- 192,208 ---- { static Arg textArgs[] = { {XtNfile, 0}, + {XtNfromVert, (XtArgVal)NULL}, {XtNtextOptions, (XtArgVal)scrollVertical }, {XtNeditType, (XtArgVal)XttextAppend}, {XtNwidth, 500}, {XtNheight, 100}, }; + + static Arg eraseButtonArgs[] = { + {XtNfromHoriz, (XtArgVal)NULL}, + }; + Widget top, p, w, text; char file[MAXPATHLEN]; FILE *f; *************** *** 210,216 **** p = XtCreateManagedWidget("shell", formWidgetClass, top, NULL, ZERO); w = XtCreateManagedWidget("quit", commandWidgetClass, p, NULL, ZERO); XtAddCallback(w, XtNcallback, Quit, NULL); ! w = XtCreateManagedWidget("erase", commandWidgetClass, p, NULL, ZERO); /*XtAddCallback(w, XtNcallback, Erase, NULL);*/ XtSetSensitive(w, False); --- 216,224 ---- p = XtCreateManagedWidget("shell", formWidgetClass, top, NULL, ZERO); w = XtCreateManagedWidget("quit", commandWidgetClass, p, NULL, ZERO); XtAddCallback(w, XtNcallback, Quit, NULL); ! ! eraseButtonArgs[0].value = (XtArgVal)w; ! w = XtCreateManagedWidget("erase", commandWidgetClass, p, eraseButtonArgs, XtNumber(eraseButtonArgs)); /*XtAddCallback(w, XtNcallback, Erase, NULL);*/ XtSetSensitive(w, False); *************** *** 224,229 **** --- 232,238 ---- textArgs[0].value = (XtArgVal)file; if (app_resources.word_wrap) textArgs[1].value |= wordBreak; + textArgs[1].value = (XtArgVal)w; text = XtCreateManagedWidget( "text", asciiDiskWidgetClass, p, textArgs, XtNumber(textArgs) );