diff options
Diffstat (limited to 'ui.c')
| -rw-r--r-- | ui.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -51,7 +51,7 @@ ui_init(int argc, char **argv) XSetBackground(dsp, gc, bg); XSetForeground(dsp, gc, fg); - XSelectInput(dsp, win, ButtonPressMask | KeyPressMask | ExposureMask); + XSelectInput(dsp, win, KeyPressMask | ExposureMask); XMapRaised(dsp, win); freg = XLoadFont(dsp, "-*-new century schoolbook-medium-r-*-*-24-*-*-*-*-*-*-*"); @@ -103,7 +103,7 @@ ui_wait_event(UiEvent *e) } void -ui_draw(Str input, int inpi, int seli, Str *optv, int optc) +ui_draw(Str input, int inpi, int seli, UiOpts o) { XWindowAttributes attr; XClearWindow(dsp, win); @@ -120,23 +120,23 @@ ui_draw(Str input, int inpi, int seli, Str *optv, int optc) /* draw options */ XSetFont(dsp, gc, freg); - for (int i = 0; i < optc; i++) { + for (int i = 0; i < o.n; i++) { if (i == seli) { int w = XTextWidth(XQueryFont(dsp, XGContextFromGC(gc)), - optv[i].s, optv[i].n); + o.v[i].s, o.v[i].n); XFillRectangle(dsp, win, gc, 16, 28 + i * 24 + 8, w, 24); XSetForeground(dsp, gc, bg); XDrawString(dsp, win, gc, 16, 48 + i * 24 + 8, - optv[i].s, optv[i].n); + o.v[i].s, o.v[i].n); XSetForeground(dsp, gc, fg); } else { XDrawString(dsp, win, gc, 16, 48 + i * 24 + 8, - optv[i].s, optv[i].n); + o.v[i].s, o.v[i].n); } } } |
