8 frinit(Frame *f, Rectangle r, Font *ft, Image *b, Image *cols[NCOL])
11 f->display = b->display;
12 f->maxtab = 8*stringwidth(ft, "0");
22 memmove(f->cols, cols, sizeof f->cols);
24 if(f->tick==nil && f->cols[BACK]!=0)
34 if(f->cols[BACK] == nil || f->display == nil)
36 f->tickscale = scalesize(f->display, 1);
37 b = f->display->screenimage;
41 f->tick = allocimage(f->display, Rect(0, 0, f->tickscale*FRTICKW, ft->height), b->chan, 0, DWhite);
45 freeimage(f->tickback);
46 f->tickback = allocimage(f->display, f->tick->r, b->chan, 0, DWhite);
52 /* background color */
53 draw(f->tick, f->tick->r, f->cols[BACK], nil, ZP);
55 draw(f->tick, Rect(f->tickscale*(FRTICKW/2), 0, f->tickscale*(FRTICKW/2+1), ft->height), f->display->black, nil, ZP);
57 draw(f->tick, Rect(0, 0, f->tickscale*FRTICKW, f->tickscale*FRTICKW), f->cols[TEXT], nil, ZP);
58 draw(f->tick, Rect(0, ft->height-f->tickscale*FRTICKW, f->tickscale*FRTICKW, ft->height), f->cols[TEXT], nil, ZP);
62 frsetrects(Frame *f, Rectangle r, Image *b)
67 f->r.max.y -= (r.max.y-r.min.y)%f->font->height;
68 f->maxlines = (r.max.y-r.min.y)/f->font->height;
72 frclear(Frame *f, int freeall)
75 _frdelbox(f, 0, f->nbox-1);
80 freeimage(f->tickback);