From 2ce3688e6975d3ead926e0ac8551823982ae1e8f Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sat, 3 Oct 2015 12:10:42 +0000 Subject: [PATCH] Adapt menu to ncurses ABI 6, and clear a warning --- menu/Makefile | 2 +- menu/lxdialog/menubox.c | 4 ++++ menu/lxdialog/textbox.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/menu/Makefile b/menu/Makefile index b619a4e..8a40c98 100644 --- a/menu/Makefile +++ b/menu/Makefile @@ -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 \ diff --git a/menu/lxdialog/menubox.c b/menu/lxdialog/menubox.c index d0990c3..1243060 100644 --- a/menu/lxdialog/menubox.c +++ b/menu/lxdialog/menubox.c @@ -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 ' ': diff --git a/menu/lxdialog/textbox.c b/menu/lxdialog/textbox.c index 21312eb..59edc8c 100644 --- a/menu/lxdialog/textbox.c +++ b/menu/lxdialog/textbox.c @@ -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 */