Wind* windmk(char *label, char *target) { Wind *w; w = mallocz(sizeof(*w), 1); w->cs = newcontrolset(screen, nil, nil, nil); w->column = createcolumn(w->cs, "column"); w->top = createlabel(w->cs, "top"); w->body = createtext(w->cs, "body"); w->input = createentry(w->cs, "input"); w->event = chancreate(sizeof(char*), 0); w->blines = 0; if(target != nil) w->target = strdup(target); ctlprint(w->top, "value %s", label); ctlprint(w->top, "border 1"); ctlprint(w->top, "size %d %d %d %d", 10, font->height+1, 10000, font->height+1); ctlprint(w->body, "border 1"); ctlprint(w->body, "scroll 1"); ctlprint(w->input, "border 1"); ctlprint(w->input, "size %d %d %d %d", 10, font->height+1, 10000, font->height+1); controlwire(w->input, "event", w->event); chanprint(w->cs->ctl, "column add top"); chanprint(w->cs->ctl, "column add body"); chanprint(w->cs->ctl, "column add input"); activate(w->input); return w; }
void makeoptions() { showmouse(); createwindows(0,5,5,150,75,0,4,"BrUsH CoLoR"); createlist(0,0,15,25); additem(0,0,"Black"); additem(0,0,"Blue"); additem(0,0,"Green"); additem(0,0,"Cyan"); additem(0,0,"Red"); additem(0,0,"Magenta"); additem(0,0,"Brown"); additem(0,0,"Lt. Gray"); additem(0,0,"Gray"); additem(0,0,"Lt. Blue"); additem(0,0,"Lt. Green"); additem(0,0,"Lt. Cyan"); additem(0,0,"Pink"); additem(0,0,"Lt. Magenta"); additem(0,0,"Yellow"); additem(0,0,"White"); additem(0,0,"Transparent"); createwindows(1,5,80,175,220,0,4,"BrUsH aTTrIbUtEs"); createlist(1,0,15,115); createlist(1,1,15,185); createlabel(1,0,15,100,125,112,4); createlabel(1,1,15,170,125,182,4); changelabel(1,0,"Brush Type"); changelabel(1,1,"Brush Width"); additem(1,0,"Freehand"); additem(1,0,"Flood Fill"); additem(1,0,"Line"); additem(1,0,"Rectangle"); //additem(1,0,"Circle"); //additem(1,0,"Filled Circle"); //additem(1,0,"Filled Rectangle"); additem(1,1,"1"); additem(1,1,"2"); additem(1,1,"3"); additem(1,1,"4"); additem(1,1,"5"); createwindows(2,5,225,290,375,0,4,"FiLe oPtIoNs"); createtext(2,0,20,265,280,285); createlabel(2,0,20,250,170,262,5); changelabel(2,0,"Filename:"); createbutton(2,0,20,290,90,330,3,"Save"); createbutton(2,1,100,290,170,330,3,"Load"); createbutton(2,2,20,340,170,360,4,"Quit"); createwindows(3,300,10,610,400,0,4,"DrAwInG gRiD"); createbutton(3,0,310,375,410,397,5,"Clear Grid"); cleargrid(); }