Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!stc.lockheed.COM!pk From: pk@stc.lockheed.COM (PK) Newsgroups: comp.windows.x Subject: Re: application control of scrollbar Message-ID: <9008232306.AA06613@sapphire.STC.LOCKHEED.COM> Date: 23 Aug 90 23:06:50 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 47 Here is a diff file that has a function that I defined which has worked for me. XawViewportMoveChild(widget,xoffset,yoffset) The offsets are specified as floats ranging from 0 to 1 which determines the offset from the top left corner. A value of -1 will leave the particular axis unchanged. PK pk@nmsu.edu pk@stc.lockheed.com *** Viewport.c Tue Jul 3 14:44:42 1990 --- /src/R4/mit/lib/Xaw/Viewport.c Fri Dec 15 10:37:55 1989 *************** *** 409,437 **** RedrawThumbs(w); } - void XawViewportMoveChild(w,xoff,yoff) - ViewportWidget w; - float xoff,yoff; - { - register Widget child = w->viewport.child; - Position x,y; - - if(xoff > 1.0) /* If the offset is > 1.0 scroll to */ - x = child->core.width; /* extreme right */ - else if (xoff < 0.0) /* if the offset is < 0.0 no movement */ - x = child->core.x; /* in the x direction */ - else - x = child->core.width * xoff; - if(yoff > 1.0) - y = child->core.height; - else if (yoff < 0.0) - y = child->core.y; - else - y = child->core.height * yoff; - - MoveChild(w,-x,-y); - } - static void ComputeLayout(widget, query, destroy_scrollbars) Widget widget; /* Viewport */ --- 409,414 ----