File:  [Research Unix] / researchv9 / jtools / src / sunlib / t2.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#include "jerq.h"

static char *editstrs[]={
	"cut",
	"paste",
	"snarf",
	"send",
	"cut",
	"paste",
	"snarf",
	"send",
	"cut",
	"paste",
	"snarf",
	"send",
	"paste",
	"snarf",
	"send",
	"cut",
	"paste",
	"snarf",
	"send",
	0,
};
static	Menu	editmenu = {editstrs};

main(argc, argv)
char **argv;
{
	int i, h, w, y;
	static char *s = "Hello world";
	char c[2];

	request(KBD|MOUSE);
	initdisplay(argc, argv);

	c[1] = 0;
	h = fontheight(&defont);
	y = h + 5;
	w = strwidth(&defont, "m");
	for(i = 0; ; ){
		wait(MOUSE|KBD);
		if(P->state & KBD){
			c[0] = kbdchar();
			string(&defont, c, &display, Pt(10+w*i, y), F_OR);
			i++;
			if(i > 50){
				i = 0;
				y += h;
			}
		}
		if(button2())
			menuhit(&editmenu, 2);
		else if(button3())
			break;
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.