[comp.windows.news] Setting a background

gregm@SUN.COM (Greg McLaughlin) (10/14/87)

Here is some code from my user.ps that does this very thing...


/ImagePaintRoot { % string => -
        gsave
                readcanvas
                framebuffer setcanvas clippath pathbbox scale pop pop
                imagecanvas
        grestore
        } def

/imagemenu [
    (founders)          { /PaintRoot
                                /ImagePaintRoot
                                {(NEWSHOME) getenv (/smi/founders.im8) append}
                                        {} modifyproc
                                store PaintRoot }
    (cartoon)           { /PaintRoot
                                /ImagePaintRoot {(Backgrounds/cartoon.im1) } {}
                                        modifyproc
                                store PaintRoot }

%	:
%	:
%	:
] makemenu def

Just add imagemenu to your main menu and select all the image backgrounds you
like.

This works best if the framebuffer is retained since readcanvas stops up the
works on you for a while.


Greg McLaughlin
Portable NeWS
Sun Microsystems Inc