+init_screen(
+#if HAVE_USE_WINDOW
+ SCREEN *sp GCC_UNUSED,
+#endif
+ void *arg)
+{
+ DITTO *target = (DITTO *) arg;
+ int high, wide;
+ int k;
+
+ cbreak();
+ noecho();
+ scrollok(stdscr, TRUE);
+ box(stdscr, 0, 0);
+
+ target->parents = typeCalloc(WINDOW *, (size_t) target->length);
+ target->windows = typeCalloc(WINDOW *, (size_t) target->length);
+ target->peeks = typeCalloc(PEEK, (size_t) target->length);
+
+ high = (LINES - 2) / target->length;
+ wide = (COLS - 2);
+ for (k = 0; k < target->length; ++k) {
+ WINDOW *outer = newwin(high, wide, 1 + (high * k), 1);
+ WINDOW *inner = derwin(outer, high - 2, wide - 2, 1, 1);
+
+ box(outer, 0, 0);
+ MvWAddStr(outer, 0, 2, target->titles[k]);
+ wnoutrefresh(outer);
+
+ scrollok(inner, TRUE);
+ keypad(inner, TRUE);
+#ifndef USE_PTHREADS
+ nodelay(inner, TRUE);
+#endif
+
+ target->parents[k] = outer;
+ target->windows[k] = inner;
+ }
+ doupdate();
+ return TRUE;
+}
+
+static void
+open_screen(DITTO * target, char **source, int length, int which1)