Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!bierstat.scd.ucar.edu!morreale From: morreale@bierstadt.scd.ucar.edu (Peter Morreale) Newsgroups: comp.windows.x Subject: Re: Athena Problems Message-ID: <10531@ncar.ucar.edu> Date: 8 Mar 91 18:52:11 GMT References: <169@sos.com> Sender: news@ncar.ucar.edu Reply-To: morreale@bierstadt.scd.ucar.edu (Peter Morreale) Organization: Scientific Computing Division / NCAR, Boulder Co. Lines: 69 In article <169@sos.com>, ronnie@sos.com (Ron Schnell) writes: > > .... Could someone please tell me if this is a known bug? Don't know that I'd call it a bug, rather a "feature" ;-) > I have a list under a viewport under a box. The viewport has fixed > values for both width and height. If the viewport will always have a fixed width and height, *and* it sits in a form widget, I suspect you could constrain the viewport to not resize by setting the following constraint resources, here's an example: XtSetArg(arg[n], XtNleft, XtChainLeft); ++n; XtSetArg(arg[n], XtNright, XtChainLeft); ++n; XtSetArg(arg[n], XtNtop, XtChainTop); ++n; XtSetArg(arg[n], XtNbottom, XtChainTop); ++n; Refer to pages: 105-106 of the MIT document "Athena Widget Set - C Language Interface" for details. I suspect this will work, though I haven't tried it personally. > > > However, if I change the list with XtListChange, and the list height > is still smaller, the viewport will suddenly SHRINK DOWN...so much > that it even cuts off the bottom element of the list. I don't > think that the viewport should shrink at all. More than likely, you have the last argument to XawListChange set to "True". This causes the list to tell the viewport that it is ok to resize itself to the actual size of the list. Just setting that argument to "False" doesn't work either as the scrollbar in the viewport will not reset itself to accomodate the new list items. In my case, I wanted to allow the user the ability to resize the app and have my viewport resize accordingly. What I did was to grab the width of the viewport, reset the list items (with the last arg set to "False") , then reset the width of the viewport to itself. I suspect what is was needed is to send an expose event (??) to the viewport to get it to reset the scrollbar. This is certainly kludgy, but it works nicely and there isn't the offensive visual that mapping and unmapping causes. Here is my code: /* Update the list and reset the scrollbar thumb */ XtSetArg(arg[0], XtNwidth, &width); XtGetValues(Entries, arg, 1); XtSetArg(arg[0], XtNwidth, width); XawListChange(List, p, cnt, -1 , False); XtSetValues(Entries, arg, 1); What is the "correct" method? -PWM ------------------------------------------------------------------ Peter W. Morreale email: morreale@ncar.ucar.edu Nat'l Center for Atmos Research voice: (303) 497-1293 Scientific Computing Division Consulting Office ------------------------------------------------------------------