diff options
| author | katalx | 2026-01-28 20:46:43 -0500 |
|---|---|---|
| committer | katalx | 2026-01-28 20:46:43 -0500 |
| commit | 583bcd490a055f013b244a6cd7e6ecb6765260e2 (patch) | |
| tree | 30b6d9d0237d9ae6ea4e57db964d4d409dc152b9 /ui.c | |
| parent | 86a10e053154cb52ab7d051b98a6366c6165c02b (diff) | |
read stdin into opt array
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); } } } |
