use draw_color_new()

This commit is contained in:
Julien Danjou 2008-01-27 18:59:12 +01:00
parent b6642e45c8
commit c26d5242d5
1 changed files with 3 additions and 6 deletions

View File

@ -41,7 +41,7 @@ main(int argc, char **argv)
Display *disp; Display *disp;
SimpleWindow *sw; SimpleWindow *sw;
DrawCtx *ctx; DrawCtx *ctx;
XColor fg, bg, c; XColor fg, bg;
XEvent ev; XEvent ev;
Bool running = True; Bool running = True;
const char *fg_color = "#000000"; const char *fg_color = "#000000";
@ -105,12 +105,9 @@ main(int argc, char **argv)
ctx = draw_get_context(disp, DefaultScreen(disp), ctx = draw_get_context(disp, DefaultScreen(disp),
geometry.width, geometry.height, sw->drawable); geometry.width, geometry.height, sw->drawable);
/* XXX replace by initxcolor() */
XAllocNamedColor(disp, DefaultColormap(disp, DefaultScreen(disp)),
bg_color, &bg, &c);
XAllocNamedColor(disp, DefaultColormap(disp, DefaultScreen(disp)), bg = draw_color_new(disp, DefaultScreen(disp), bg_color);
fg_color, &fg, &c); fg = draw_color_new(disp, DefaultScreen(disp), fg_color);
geometry.x = geometry.y = 0; geometry.x = geometry.y = 0;
draw_text(ctx, geometry, AlignRight, draw_text(ctx, geometry, AlignRight,