[comp.windows.x] Big View Port

alien@piccolo.ecn.purdue.edu (Yin Chan) (03/10/91)

Hi everybody,

	I am working on the Athena Widget set.  I am supposed to draw some
things like circles, squares etc on a window.  But since there are so many of
them that I want to put them in a sort of very large pixmap (bigger than the
dimension of the screen) and then use the View port to scroll the content of
the pixmap.  Is there any simple way to do that?  Any help or sample program
will be appreciated!

	Thanks in advance.

Yin

cjmchale@cs.tcd.ie (Ciaran McHale) (03/11/91)

In <1991Mar10.075412.11997@noose.ecn.purdue.edu>
alien@piccolo.ecn.purdue.edu (Yin Chan) writes:

>	I am working on the Athena Widget set.  I am supposed to draw some
>things like circles, squares etc on a window.  But since there are so many of
>them that I want to put them in a sort of very large pixmap (bigger than the
>dimension of the screen) and then use the View port to scroll the content of
>the pixmap.  Is there any simple way to do that?  Any help or sample program
>will be appreciated!

Many servers will reject an attempt to create a pixmap which
is larger than the root window. Even if the server allows
you to create such a large pixmap, it would most likely eat
up *lots* of memory. (For example, a 1024x1024x8 pixmap
costs 1 megabyte.)

But, if that's the way you want to do things ...

Create a widget (as a child of the viewport) and set its
background to be the pixmap. Whenever you draw into the
pixmap, reset the background of the window to be the pixmap
and call XClearWindow().


Ciaran.
-- 
Ciaran McHale		"Verbosity says it all"			      ____
Department of Computer Science, Trinity College, Dublin 2, Ireland.   \  /
Telephone: +353-1-772941 ext 1538	FAX: +353-1-772204	       \/
Telex: 93782 TCD EI			email: cjmchale@cs.tcd.ie