Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!ames!sgi!paul@manray.asd.sgi.com From: paul@manray.asd.sgi.com (Paul Haeberli) Newsgroups: comp.sys.sgi Subject: Swell code fragment . . . . . . . Message-ID: <63004@sgi.sgi.com> Date: 27 Jun 90 23:06:59 GMT Sender: paul@manray.asd.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 123 Hey! here's a little fragment of code that makes it easy to provide the user with a little moving hour-glass cursor to show percent done. paul haeberli paul@sgi.com /* * percent - * Indicate percent done on time consuming operations. * * Paul Haeberli - 1985 * * to use: * * . * . * winopen("name"); * . * . * percentdone(0.0); * for(y=0; y 99.9) { setcursor(oldcursor,0xfff,0xfff); curindex = -1; } else { index = percent*NCURSORS/100.0; if (index<0) index = 0; if (index>=NCURSORS) index = NCURSORS-1; if (index != curindex) { defcursor(20,curtab[index]); curorigin(20,7,7); setcursor(20,0xfff,0xfff); curindex = index; } } }