Adapt menu to ncurses ABI 6, and clear a warning

This commit is contained in:
Pierre Labastie 2015-10-03 12:10:42 +00:00
parent 6f48f76f20
commit 2ce3688e69
3 changed files with 7 additions and 1 deletions

View file

@ -125,7 +125,7 @@ zconf.tab.o: zconf.tab.c lex.zconf.c $(srcdir)/confdata.c $(srcdir)/expr.c \
.PHONY: ncurses .PHONY: ncurses
ncurses: ncurses:
@echo "main() {}" > lxtemp.c @echo "int main() {}" > lxtemp.c
@if $(HOSTCC) lxtemp.c $(LIBS) ; then \ @if $(HOSTCC) lxtemp.c $(LIBS) ; then \
rm -f lxtemp.c a.out; \ rm -f lxtemp.c a.out; \
else \ else \

View file

@ -269,7 +269,9 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
print_arrows(dialog, item_no, scroll, print_arrows(dialog, item_no, scroll,
box_y, box_x+item_x+1, menu_height); box_y, box_x+item_x+1, menu_height);
wbkgdset (dialog, 0);
print_buttons (dialog, height, width, 0); print_buttons (dialog, height, width, 0);
wbkgdset (dialog, dialog_attr & A_COLOR);
wmove (menu, choice, item_x+1); wmove (menu, choice, item_x+1);
wrefresh (menu); wrefresh (menu);
@ -390,7 +392,9 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
button = ((key == KEY_LEFT ? --button : ++button) < 0) button = ((key == KEY_LEFT ? --button : ++button) < 0)
? 2 : (button > 2 ? 0 : button); ? 2 : (button > 2 ? 0 : button);
wbkgdset (dialog, 0);
print_buttons(dialog, height, width, button); print_buttons(dialog, height, width, button);
wbkgdset (dialog, dialog_attr & A_COLOR);
wrefresh (menu); wrefresh (menu);
break; break;
case ' ': case ' ':

View file

@ -117,7 +117,9 @@ dialog_textbox (const char *title, const char *file, int height, int width)
waddstr (dialog, (char *)title); waddstr (dialog, (char *)title);
waddch (dialog, ' '); waddch (dialog, ' ');
} }
wbkgdset (dialog, 0);
print_button (dialog, " Exit ", height - 2, width / 2 - 4, TRUE); print_button (dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
wbkgdset (dialog, dialog_attr & A_COLOR);
wnoutrefresh (dialog); wnoutrefresh (dialog);
getyx (dialog, cur_y, cur_x); /* Save cursor position */ getyx (dialog, cur_y, cur_x); /* Save cursor position */