Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!meepmeep.UUCP!jkh From: jkh@meepmeep.UUCP (Jordan K. Hubbard) Newsgroups: comp.windows.x Subject: Bug in Viewport widget? Message-ID: <8903011608.AA04842@meepmeep.UUCP> Date: 1 Mar 89 21:08:41 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 91 Symptom: When a viewport is resized to be *larger* than the client's minimum desired size, it does not enlarge the child. Repeat-By: Compile the following program. Run it with some numeric argument (the size of the asciiStringWidget's buffer) and let the window have its default minimum size (if you're running uwm or awm, place it with the left button). You should see a "text" cursor in all portions of the window. Make the window larger. You will still see the text cursor in the *original* window boundries, but the "gobbler" cursor in the extended areas. This is the cursor of the viewport window. The child has not been resized. If the window is made smaller, the correct behaviour is observed (scroll bars are added vertically and horizontally as needed). In no case will the text window be made larger than its original size. Is this a feature? Fix: Look at the viewport code for 15 minutes. Run around in circles until you throw up. Sorry, I don't have a fix. ---- code follows ---- #include #include #include #include #include #include #include Arg args[10]; Cardinal i; Widget Toplevel, Output; int Buflen; char *Buffer; main(ac, av) Cardinal ac; String *av; { Widget tmp; static Arg arglist[] = { {XtNstring, (XtArgVal) NULL}, {XtNlength, (XtArgVal) NULL}, {XtNheight, (XtArgVal) 200 }, {XtNtextOptions, scrollVertical}, {XtNtextOptions, scrollHorizontal}, {XtNtextOptions, scrollOnOverflow}, }; setbuf(stderr, NULL); if (ac < 2) { fprintf(stderr, "length expected\n"); exit(1); } Toplevel = XtInitialize("test", "Test", NULL, NULL, &ac, av); i = 0; XtSetArg(args[i], XtNallowShellResize, (XtArgVal)TRUE); i++; XtSetValues(Toplevel, args, i); i = 0; XtSetArg(args[i], XtNallowVert, (XtArgVal)TRUE); i++; XtSetArg(args[i], XtNallowHoriz, (XtArgVal)TRUE); i++; tmp = XtCreateManagedWidget(NULL, viewportWidgetClass, Toplevel, args, i); Buflen = atoi(av[1]); Buffer = (char *)XtMalloc(Buflen); bzero(Buffer, Buflen); arglist[0].value = (XtArgVal)Buffer; arglist[1].value = (XtArgVal)Buflen; Output = XtCreateManagedWidget("output", asciiStringWidgetClass, tmp, arglist, XtNumber(arglist)); XtTextEnableRedisplay(Output); XtRealizeWidget(Toplevel); XDefineCursor(XtDisplay(Toplevel), XtWindow(Toplevel), XCreateFontCursor(XtDisplay(Toplevel), XC_boat)); XDefineCursor(XtDisplay(Toplevel), XtWindow(tmp), XCreateFontCursor(XtDisplay(Toplevel), XC_gobbler)); XtMainLoop(); }