home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!iWarp.intel.com|daw
- From: daw@iwarp.intel.com (David A. White)
- Subject: Scrolling a window....
- Message-ID: <1992Jul27.003635.4498@iWarp.intel.com>
- Sender: daw@iWarp.intel.com
- Nntp-Posting-Host: r0.iwarp.intel.com
- Organization: Supercomputer Systems Division, Intel Corp.
- References: <1992Jul23.163551.371@cine88.cineca.it> <3352@sicsun.epfl.ch>
- Date: Mon, 27 Jul 1992 00:36:35 GMT
- Lines: 39
-
- I have created a Motif application that allows the editting of a graph.
- The graph is displayed inside scrolledwindow (application defined) on a
- drawing area widget
-
- The Xlib code draws the graph directly onto the window, using
- expose, resize, and motion events.
-
- I wanted to scroll the contents of the window efficiently when the user uses
- the scrollbar.
-
- I tried using XCopyArea() to do this by first copying from the window to a
- Pixmap I created, and then copying from the Pixmap back to the window in a new
- location. This worked fine as long as there was no other window on top of the
- window being scrolled. However, if my drawingarea window was obscured, then
- the first XCopyArea() would not get the correct information so garbage would
- appear in the window when it was copied back. I could not get GraphicsExpose
- events from this because the destination is not a window.
-
- To fix this, I used XCopyArea() iteratively to move the window to itself in
- pieces so GraphicsExpose events would be generated. This worked, but is very
- inefficient if the window is scrolled just a few pixels (requires
- WindowDimension/PixelChange XCopyArea() calls).
-
- There MUST be an easy and efficient way to do this, but I can not figure
- out what it is.
-
- I did think about drawing everything into a Pixmap, and then only using
- XCopyArea() to display it in the drawingarea window. But then I would have to
- rewrite a lot of code, and my code new works fine except for this problem.
-
- Any suggestions would be greatly appreciated. Email or a followup post is
- acceptable.
-
- - Dave White daw@iWarp.intel.com
- --
- Dave White
- Compiler/Optimizer Group, iWarp Program, Intel Corporation
- Cornell Oaks 4 (Zone 5), just right of A4, Mail Stop CO4-02
- W: (503) 629-6315 H:(503) 645-5581
-