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
ncurses:
@echo "main() {}" > lxtemp.c
@echo "int main() {}" > lxtemp.c
@if $(HOSTCC) lxtemp.c $(LIBS) ; then \
rm -f lxtemp.c a.out; \
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,
box_y, box_x+item_x+1, menu_height);
wbkgdset (dialog, 0);
print_buttons (dialog, height, width, 0);
wbkgdset (dialog, dialog_attr & A_COLOR);
wmove (menu, choice, item_x+1);
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)
? 2 : (button > 2 ? 0 : button);
wbkgdset (dialog, 0);
print_buttons(dialog, height, width, button);
wbkgdset (dialog, dialog_attr & A_COLOR);
wrefresh (menu);
break;
case ' ':

View file

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