[comp.windows.x] Problems: viewports and scrolling

lange@exunido.uucp (Rainer Lange) (12/12/88)

Hi Xperts,
we 've got a problem concerning viewport-widgets.
We installed a simple widget as the child of a viewport
in order to use the viewports capabilities of scrolling.
Using Xlib-functions we draw some stuff into the window
of the simple widget. Up to this point R3 operates fine
(as Xpected). 

Any movement of the viewports scrollbars actually scrolls
the contents of the simple widget, but scrolling back does
no update of the former invisible (since scrolled) contents.

Any suggestions ?          Thanx in advance Lutz & Rainer

kochhar@babbage.harvard.edu (Sandeep Kochhar) (12/14/88)

In article <778@laura.UUCP> lange@exunido.UUCP (Rainer Lange) writes:
>
>Hi Xperts,
>we 've got a problem concerning viewport-widgets.
>We installed a simple widget as the child of a viewport
>in order to use the viewports capabilities of scrolling.
>Using Xlib-functions we draw some stuff into the window
>of the simple widget. Up to this point R3 operates fine
>(as Xpected). 
>
>Any movement of the viewports scrollbars actually scrolls
>the contents of the simple widget, but scrolling back does
>no update of the former invisible (since scrolled) contents.
>
>Any suggestions ?          Thanx in advance Lutz & Rainer

I think you need to use the Expose events generated via
the scrolling process to redraw portions of the child widget.
An alternative is to set the BackingStore of the window
of the child widget to Always.  However, the second assumes
that the server provides backing store.  Since the current
protocol allows the servers to throw away backing stores
at any time and generate expose events, you should use 
both method together.

thanks.
sandeep kochhar
email: kochhar@harvard.harvard.edu