[comp.windows.x] How to force scroll position in Athena Viewport

dce@smsc.sony.com (David Elliott) (07/30/90)

I have a List inside of a Viewport, and I'll be automatically
highlighting items, and I'd like to be able to set the scroll of the
window so that the highlighted item and all items below it (within
reason) are in view.

It doesn't look like there's any way to set the scroll position
of either of the Viewport scrollbars, or even to get the widgets
themselves.

Does anyone know of a way to do this?  If not, does anyone know
a reason why the Viewport widget shouldn't be modified to make it
possible to get the scrollbar widgets?

-- 
...David Elliott
...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
...(408)944-4073
..."Damn! I'm running out of integers!"

rlh2@ukc.ac.uk (Richard Hesketh) (07/30/90)

In article <1990Jul30.004715.2019@smsc.sony.com> dce@smsc.sony.com (David Elliott) writes:
>I have a List inside of a Viewport, and I'll be automatically
>highlighting items, and I'd like to be able to set the scroll of the
>window so that the highlighted item and all items below it (within
>reason) are in view.

I've created a new widget class "Scrollable List" that does just this,
and jolly useful it is too.  It required a change to the viewport
to do the scrolling though (see below).

>It doesn't look like there's any way to set the scroll position
>of either of the Viewport scrollbars, or even to get the widgets
>themselves.

This is very true, unfortunately.  I wanted this and to use a different
scrollbar class that gives thumb-bar "ticks" and so I created my own.
Essentially the geometry management of the viewport disallows
any x or y movement of a child by a SetValues call.

>Does anyone know of a way to do this?

You have to get the viewport modified or create your own.

>                                       If not, does anyone know
>a reason why the Viewport widget shouldn't be modified to make it
>possible to get the scrollbar widgets?

I've got a patch for the Athena Viewport that allows you to change the
position of the child when the scrollbars are on (of course the thumbs
move as well).  It appears I haven't sent it off as a bug report, so I
will and if you send me mail I'll send you a copy as well.

>...David Elliott
>...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce

Richard Hesketh   :   @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk
		  :   rlh2@ukc.ac.uk    ..!mcsun!ukc!rlh2
---                                               
Computing Lab., University of Kent at Canterbury,
Canterbury, Kent, CT2 7NF, United Kingdom.    Tel: +44 227 764000 ext 7620/3682