29 int x = width / 2 - 10;
32 print_button(dialog, gettext(
" Yes "), y, x, selected == 0);
33 print_button(dialog, gettext(
" No "), y, x + 13, selected == 1);
35 wmove(dialog, y, x + 1 + 13 * selected);
42 int dialog_yesno(
const char *title,
const char *prompt,
int height,
int width)
48 if (getmaxy(stdscr) < (height + 4))
50 if (getmaxx(stdscr) < (width + 4))
59 dialog = newwin(height, width, y, x);
62 draw_box(dialog, 0, 0, height, width,
63 dlg.dialog.atr,
dlg.border.atr);
64 wattrset(dialog,
dlg.border.atr);
65 mvwaddch(dialog, height - 3, 0,
ACS_LTEE);
66 for (i = 0; i < width - 2; i++)
68 wattrset(dialog,
dlg.dialog.atr);
73 wattrset(dialog,
dlg.dialog.atr);
76 print_buttons(dialog, height, width, 0);
95 print_buttons(dialog, height, width,
button);