[comp.sys.next] Background 2

sstreep@next.com (Sam Streeper) (03/20/91)

The new version of Background is kind of neat, but there's a bug in the
menu building code.  It looks something like this:

    for (i=0; i<[matrix cellCount]; i++) [matrix removeRowAt:0 andFree:YES];

the cellCount is changing, so it doesn't make a very good loop counter
in this case  :^)  It should probably be something like:

    while ([matrix cellCount]) [matrix removeRowAt:0 andFree:YES];




By the way, a program like this tends to require quite a bit of memory
for a large window server window.  If you tire of the grey default
background, you could use a script like the following one which fills
the background with the grey or color of your choice and requires no
memory, since the background is filled directly in video memory.

Call this like this:
backgroundcolor .5 .5 .5

------------------8<--------------------------------
#!/bin/csh -f

#echo $0 : setting background color

/usr/bin/pft << MyEOF > /dev/null

14 windowdeviceround $1 $2 $3 setrgbcolor setexposurecolor
14 currentwindowbounds Nonretained window /w exch def
false w setautofill
Above 0 w orderwindow
w termwindow

MyEOF

------------------8<--------------------------------