+static int
+move_menu(MENU * menu, MENU * current, int by_y, int by_x)
+{
+ WINDOW *top_win = menu_win(menu);
+ WINDOW *sub_win = menu_sub(menu);
+ int y0, x0;
+ int y1, x1;
+ int result;
+
+ getbegyx(top_win, y0, x0);
+ y0 += by_y;
+ x0 += by_x;
+
+ getbegyx(sub_win, y1, x1);
+ y1 += by_y;
+ x1 += by_x;
+
+ if ((result = mvwin(top_win, y0, x0)) != ERR) {
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH < 20060218)
+ sub_win->_begy = y1;
+ sub_win->_begx = x1;
+#else
+ mvwin(sub_win, y1, x1);
+#endif
+ if (menu == current) {
+ touchwin(top_win);
+ wnoutrefresh(top_win);
+ }
+ }
+ return result;
+}
+
+/*
+ * Move the menus around on the screen, to test mvwin().
+ */
+static void
+move_menus(MENU * current, int by_y, int by_x)
+{
+ if (move_menu(mpBanner, current, by_y, by_x) != ERR) {
+ erase();
+ wnoutrefresh(stdscr);
+ move_menu(mpFile, current, by_y, by_x);
+ move_menu(mpSelect, current, by_y, by_x);
+#ifdef TRACE
+ move_menu(mpTrace, current, by_y, by_x);
+#endif
+ doupdate();
+ }
+}
+
+#if defined(KEY_RESIZE) && NCURSES_EXT_FUNCS
+static void
+resize_menu(MENU ** menu)
+{
+#if 0
+ WINDOW *win = menu_win(*menu);
+ WINDOW *sub = menu_sub(*menu);
+#endif
+ (void) menu;
+}
+
+static void
+resize_menus(MENU * current)
+{
+ (void) current;
+
+ werase(status);
+ wnoutrefresh(status);
+ wresize(status, 1, COLS);
+ mvwin(status, LINES - 1, 0);
+
+ resize_menu(&mpBanner);
+ resize_menu(&mpFile);
+ resize_menu(&mpSelect);
+#ifdef TRACE
+ resize_menu(&mpTrace);
+#endif
+}
+#endif /* defined(KEY_RESIZE) && NCURSES_EXT_FUNCS */
+
+static void
+show_status(int ch, MENU * menu)
+{
+ wmove(status, 0, 0);
+ wprintw(status, "key %s, menu %d, mark %s, match %s",
+ keyname(ch),
+ menu_number(),
+ menu_mark(menu),
+ menu_pattern(menu));
+ wclrtoeol(status);
+ wrefresh(status);
+}
+