[comp.windows.x.motif] to Myself

rob@knopfler.leis.bellcore.com (Rob Herrera) (12/03/90)

In regard to my previous message about scrollbars in XmAUTOMATIC,
I had some success by doing the following... (1 1/2 minutes after
posting the message)

On the increment, decrement, paging, etc. callbacks of the scrollbars
being managed by scrolled window A, use both XmScrollBarSetValues on the other scrollbars (scrolled window B), and do an XtMoveWidget on the workarea 
of scrolled window B, using the call_data->value passed down in
XmScrollBarCallbackStruct.

As I suspected, I was missing something... 

Chao, and sorry for any inconvenience...

Rob
rob@knopfler.leis.bellcore.com

steve@mnetor.UUCP (Steve Rees) (12/06/90)

In article <1990Dec3.004159.17177@bellcore.bellcore.com> rob@knopfler.leis.bellcore.com (Rob Herrera) writes:

[ basically on how to programmatically scroll a scrolledWindow widget ]...

>being managed by scrolled window A, use both XmScrollBarSetValues on the other 
>scrollbars (scrolled window B), and do an XtMoveWidget on the workarea 
>of scrolled window B, using the call_data->value passed down in
>XmScrollBarCallbackStruct.

Another, possibly cleaner way of getting the scrolled window to move is to:
1) Set the value resource on the B scrollbar, (as you say), and then
2) call XtCallCallbacks( scrollBar_B, XmNvalueChangedCallback, 
		XmScrollBarCallbackStruct )

	...where you fill in the appropriate fields in the callback struct
	(reason & value?).  It basically does the XtMoveWidget(), but this
	way you'll also activate any other callbacks which may normally get
	called on value change.  Make sense?

-- 
    Steve Rees
{uunet|utzoo}!mnetor!steve or (better) steve%mnetor.uucp@uunet.uu.net
Ma Bell: +1 416 475 8980  ext. 322
ISO-standard witty quote: "Quoth the raven, 'Eat my shorts!'" - Bart Simpson