- loadcolors(dpy, screen, &brush, BGCOLOR, FGCOLOR, BORDERCOLOR);
- loadfont(dpy, &brush.font, FONT);
-
- wa.override_redirect = 1;
- wa.background_pixmap = ParentRelative;
- wa.event_mask = ExposureMask;
-
- barrect = rect;
- barrect.height = labelheight(&brush.font);
- barrect.y = rect.height - barrect.height;
- barwin = XCreateWindow(dpy, root, barrect.x, barrect.y,
- barrect.width, barrect.height, 0, DefaultDepth(dpy, screen),
- CopyFromParent, DefaultVisual(dpy, screen),
- CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
- bartext = 0;
- XDefineCursor(dpy, barwin, cursor[CurNormal]);
- XMapRaised(dpy, barwin);
- draw_bar();
-
- wa.event_mask = SubstructureRedirectMask | EnterWindowMask | LeaveWindowMask;
+ initcolors(BGCOLOR, FGCOLOR, BORDERCOLOR);
+ initfont(&dc.font, FONT);
+
+ th = texth(&dc.font);
+
+ dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
+ dc.gc = XCreateGC(dpy, root, 0, 0);
+
+ wa.event_mask = SubstructureRedirectMask | EnterWindowMask \
+ | LeaveWindowMask;