+static void draw_kb_view(struct World * world, struct Win * win,
+ char * f_name, struct KeyBiData * kb, uint8_t start)
+{
+ char * err_hint = trouble_msg(world, f_name, "draw_scroll_hint()");
+ uint16_t kb_max = get_n_of_keybs(kb->kbs) - 1;
+ uint16_t y, x, offset;
+ offset = center_offset(kb->select, kb_max, win->frame.size.y - 1 - start);
+ uint8_t keydescwidth = 9 + 1; /* get_name_to_keycode()'s max length + \0 */
+ char keydesc[keydescwidth];
+ uint16_t nav_max = kb_max + start;
+ uint16_t y_border = win->frame.size.y + offset - 1 - start;
+ for (y = start; y <= nav_max && y < win->frame.size.y; y++)
+ {
+
+ if (start == y && offset > 0)
+ {
+ uint8_t test = draw_scroll_hint(&win->frame, y, offset + 1, '^');
+ exit_err(test, world, err_hint);
+ continue;
+ }
+ else if (win->frame.size.y == y + 1 && kb_max > y_border)
+ {
+ uint16_t pos = kb_max - (offset + win->frame.size.y) + 2 + start;
+ uint8_t test = draw_scroll_hint(&win->frame, y, pos, 'v');
+ exit_err(test, world, err_hint);
+ continue;
+ }
+
+ attr_t attri = 0;
+ if (y - start == kb->select - offset)
+ {
+ attri = A_REVERSE;
+ if (1 == kb->edit)
+ {
+ attri = attri | A_BLINK;
+ }
+ }
+
+ struct KeyBinding * kb_p;
+ kb_p = get_keyb_of_n(kb->kbs, (y - start) + offset);
+ char * keyname = get_name_to_keycode(world, kb_p->key);
+ snprintf(keydesc, keydescwidth, "%-9s", keyname);
+ free(keyname);
+ char * cmd_dsc = get_command_longdsc(world, kb_p->name);
+ uint8_t dsclen = strlen(keydesc);
+ for (x = 0; x < win->frame.size.x; x++)
+ {
+ if (x < dsclen)
+ {
+ mvwaddch(win->frame.curses_win, y, x, keydesc[x] | attri);
+ continue;
+ }
+ else if (dsclen < x && x < strlen(cmd_dsc) + strlen(keydesc) + 1)
+ {
+ chtype ch = cmd_dsc[x - strlen(keydesc) - 1] | attri;
+ mvwaddch(win->frame.curses_win, y, x, ch);
+ continue;
+ }
+ mvwaddch(win->frame.curses_win, y, x, ' ' | attri);
+ }
+
+ }
+ free(err_hint);
+}
+
+
+
+extern void draw_win_log(struct Win * win)