- waddstr(data, "Arrow keys move within a field as you would expect.");
- y2 = getcury(data);
-
- do {
- switch (ch) {
- case KEY_HOME:
- y1 = 0;
- break;
- case KEY_END:
- y1 = y2;
- break;
- case KEY_PREVIOUS:
- case KEY_PPAGE:
- if (y1 > 0) {
- y1 -= high / 2;
- if (y1 < 0)
- y1 = 0;
- } else {
- beep();
- }
- break;
- case KEY_NEXT:
- case KEY_NPAGE:
- if (y1 < y2) {
- y1 += high / 2;
- if (y1 >= y2)
- y1 = y2;
- } else {
- beep();
- }
- break;
- case CTRL('P'):
- case KEY_UP:
- if (y1 > 0)
- --y1;
- else
- beep();
- break;
- case CTRL('N'):
- case KEY_DOWN:
- if (y1 < y2)
- ++y1;
- else
- beep();
- break;
- default:
- beep();
- break;
- case ERR:
- break;
- }
- werase(help);
- box(help, 0, 0);
- wnoutrefresh(help);
- pnoutrefresh(data, y1, 0, y0 + 1, x0 + 1, high, wide);
- doupdate();
- } while ((ch = wgetch(data)) != ERR && ch != QUIT && ch != ESCAPE);
- werase(help);
- wrefresh(help);
- delwin(help);
- delwin(data);
-
- end_popup();
+ msgs[used++] =
+ strdup("Arrow keys move within a field as you would expect.");
+ msgs[used] = 0;
+ popup_msg2(stdscr, msgs);
+ for (n = 0; msgs[n] != 0; ++n) {
+ free(msgs[n]);
+ }
+ free(msgs);