Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!agate!skippy!vojta From: vojta@skippy.berkeley.edu (Paul Vojta) Newsgroups: comp.windows.x Subject: Re: Scrolling a Viewport Widget through Software Keywords: athena widget Message-ID: <26821@agate.BERKELEY.EDU> Date: 31 Jul 89 19:39:17 GMT References: <15135@duke.cs.duke.edu> Sender: usenet@agate.BERKELEY.EDU Reply-To: vojta@skippy.UUCP (Paul Vojta) Distribution: usa Organization: Math Dept., UC Berkeley Lines: 37 In article <15135@duke.cs.duke.edu> pusateri@lear.cs.duke.edu (Thomas J. Pusateri) writes: > > Has anyone figured out how to scroll an athena viewport widget >from within your program? I have a list widget that is fairly long >inside a viewport and would like to be able to type a key and have >the list widget scroll down automatically to the place in the sorted >list starting with that letter typed. > > I thought I might be able to use XtScrollbarSetThumb but I don't >know the widget ID of the actual scrollbar in the viewport. > >Thanks for any help > >Tom Pusateri >National Biomedical Simulation Resource >Duke University Medical Center > >pusateri@nbsr.mc.duke.edu How about the following: 1. Use XtGetValues to get XtNwidth and XtNheight for the viewport widget and XtNx and XtNy for the child widget (remembering that then (-x,-y) will be the upper left viewable pixel); 2. Use XtNameToWidget(vport_widget, "horizontal") and XtNameToWidget(vport_widget, "vertical") to get the widgets for the horizontal and vertical scrollbars; 3. Use XtCallCallbacks(x_bar, XtNscrollProc, x) and XtCallCallbacks(y_bar, XtNscrollProc, y) to set the scrollbars in the desired positions. I understand that step 2 above is not currently officially blessed, but that there was some discussion previously about putting the names "vertical" and "horizontal" in the documentation to make it legit. Hope this helps. --Paul Vojta, vojta@math.berkeley.edu