-
- XSetWindowBorder(dpy, c->win, dc.bg[0]);
- XMapWindow(dpy, c->twin);
- dc.x = dc.y = 0;
- dc.w = c->tw;
- drawtext(c->name, istile ? 1 : 0, False);
- XCopyArea(dpy, dc.drawable, c->twin, dc.gc, 0, 0, c->tw, c->th, 0, 0);
- XSync(dpy, False);
-}
-
-unsigned long
-getcolor(const char *colstr)
-{
- Colormap cmap = DefaultColormap(dpy, screen);
- XColor color;
-
- XAllocNamedColor(dpy, cmap, colstr, &color, &color);
- return color.pixel;
-}
-
-void
-setfont(const char *fontstr)
-{
- char **missing, *def;
- int i, n;
-
- missing = NULL;
- setlocale(LC_ALL, "");
- if(dc.font.set)
- XFreeFontSet(dpy, dc.font.set);
- dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
- if(missing) {
- while(n--)
- fprintf(stderr, "missing fontset: %s\n", missing[n]);
- XFreeStringList(missing);
- if(dc.font.set) {
- XFreeFontSet(dpy, dc.font.set);
- dc.font.set = NULL;
- }
- }