🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #23833

Re: Setting the viewable region of the Athena viewport

#23833
From: Afzal Ballim
Date: Tue, 18 Jun 1991 11:12
37 lines
1448 bytes
gnb@bby.oz.au (Gregory N. Bond) writes
>One of our users is writing an application that has a List widget
>inside a viewport widget.  He wants to be able to scroll a particular
>line of the list to the (top,center,bottom) of the viewport, but I
>can't see any calls &/| resources to do this.
>
>Hints gladly accepted.  Should this go in the FAQ?

The following allows one to change the position of a viewport
to some absolute position over its child. (Note: bounds checking 
should also be done).

 .
 .
 .
 .
ViewportWidget viewport;
Widget child;
Widget w;
Position vport_vpos,	/* where the viewport is */
	 absolute_vpos; /* absolute position to move to */
Arg arg;

absolute_vpos = 111;	/* to move to position 111 */
w = XtNameToWidget(viewport,"vertical");
XtSetArg(arg,XtNy,&vport_vpos);
XtGetValues(child,&arg,1);

XtCallCallbacks(w,XtNscrollProc,absolute_vpos+vport_vpos);
 .
 .
 .


Yes, this should go in the FAQ

-Afzal
Technical Details
Message-ID: <5787@cui.unige.ch>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!cernvax!chx400!ugun2b!cui!afzal
References: <1991Jun17.084423.11830@melba.bby.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!cernvax!chx400!ugun2b!cui!afzal
From: afzal@cui.unige.ch (Afzal Ballim)
Newsgroups: comp.windows.x
Subject: Re: Setting the viewable region of the Athena viewport
Summary: Solution
Message-ID: <5787@cui.unige.ch>
Date: 18 Jun 91 11:12:42 GMT
References: <1991Jun17.084423.11830@melba.bby.oz.au>
Organization: University of Geneva, Switzerland
Lines: 37