Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!rutgers!umn-d-ub!cs.umn.edu!thelake!steve From: steve@thelake.mn.org (Steve Yelvington) Newsgroups: comp.sys.atari.st Subject: Re: How do you create non-scrolling screen regions? Message-ID: Date: 7 Mar 90 21:53:32 GMT References: <2344@ultb.isc.rit.edu> Lines: 113 [In article <2344@ultb.isc.rit.edu>, ajy2208@ultb.isc.rit.edu (A.J. Yarusso) writes ... ] > I need to know how to create region(s) on the screen that are > independent from normal screen i/o (mainly, scrolling..). Most terminal > programs have a line or two somewhere on the screen that doesn't scroll. > Usually these are status displays to show useful information (baud rate, > system connected to, various toggles, etc..). Of course, you can do all that (and more) with GEM, but GEM is difficult and slow. The fast way is to use Line A. > I've searched my wonderful MWC manual, but there's no mention on how > to create something to this effect. To translate the following for MWC, you'll need to look at the linea.h file in your \include\ directory. It's coded for Sozobon C and Sozobon assembler. =cut here=========================== * LINEA.S -- assemble this function with jas.ttp; don't optimize it .text .globl _getlinea _getlinea: .dc.w $a000 rts =cut here=========================== /* * STATBAR.C * cc -O -DTEST statbar.c linea.o */ #include #define XP -28 /* where the current cursor X value is stored */ #define YP -26 /* where the current cursor Y value is stored */ #define LINES -42 /* where screen's size in lines is stored */ #define COLS -44 /* where screen's size in columns is stored */ #define IP(x) ((int*)(linea+(x))) /* isn't C a pretty sight? */ static long linea; extern long getlinea(); lkbar() { linea = getlinea(); (*IP(LINES))--; } unlkbar() { (*IP(LINES))++; } clrbar() { statmsg("\033K",0); } statmsg(msg, x) char *msg; int x; { int xp, yp; xp = *IP(XP); /* Save cursor's row */ yp = *IP(YP); /* and column */ unlkbar(); /* unlock the status bar */ printf("\033Y%c%c%s\033Y%c%c", 32 + *IP(LINES), /* Go to the bottom line */ 32+x, /* and column x */ msg, /* write the message */ 32+yp, /* go back to where */ 32+xp); /* we came from */ lkbar(); /* lock the status bar */ } #ifdef TEST /* * A little demo of the status bar */ main() { int i; printf("\033E"); /* clear screen, home cursor */ printf("This is a demonstration of a status bar\n"); lkbar(); clrbar(); /* * note that you should not end a status msg with a newline! */ statmsg("\033pThis is printed on the status line\033q",3); for (i=1; i<101; i++) { printf("This is line number %d\n", i); } clrbar(); statmsg("\033pPress any key to exit\033q",3); getch(); unlkbar(); } #endif -- Steve Yelvington at the lake in Minnesota UUCP path: ... umn-cs.cs.umn.edu!thelake!steve