Annotation of researchv9/jtools/src/sunlib/t2.c, revision 1.1

1.1     ! root        1: #include "jerq.h"
        !             2: 
        !             3: static char *editstrs[]={
        !             4:        "cut",
        !             5:        "paste",
        !             6:        "snarf",
        !             7:        "send",
        !             8:        "cut",
        !             9:        "paste",
        !            10:        "snarf",
        !            11:        "send",
        !            12:        "cut",
        !            13:        "paste",
        !            14:        "snarf",
        !            15:        "send",
        !            16:        "paste",
        !            17:        "snarf",
        !            18:        "send",
        !            19:        "cut",
        !            20:        "paste",
        !            21:        "snarf",
        !            22:        "send",
        !            23:        0,
        !            24: };
        !            25: static Menu    editmenu = {editstrs};
        !            26: 
        !            27: main(argc, argv)
        !            28: char **argv;
        !            29: {
        !            30:        int i, h, w, y;
        !            31:        static char *s = "Hello world";
        !            32:        char c[2];
        !            33: 
        !            34:        request(KBD|MOUSE);
        !            35:        initdisplay(argc, argv);
        !            36: 
        !            37:        c[1] = 0;
        !            38:        h = fontheight(&defont);
        !            39:        y = h + 5;
        !            40:        w = strwidth(&defont, "m");
        !            41:        for(i = 0; ; ){
        !            42:                wait(MOUSE|KBD);
        !            43:                if(P->state & KBD){
        !            44:                        c[0] = kbdchar();
        !            45:                        string(&defont, c, &display, Pt(10+w*i, y), F_OR);
        !            46:                        i++;
        !            47:                        if(i > 50){
        !            48:                                i = 0;
        !            49:                                y += h;
        !            50:                        }
        !            51:                }
        !            52:                if(button2())
        !            53:                        menuhit(&editmenu, 2);
        !            54:                else if(button3())
        !            55:                        break;
        !            56:        }
        !            57: }

unix.superglobalmegacorp.com

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