+static void
+menu_set_line_attr(int index, enum line_type type)
+{
+ WINDOW *win = menu.win;
+ int width = menu.width-2;
+ mvwchgat(win, index+1, 1, width,
+ get_line_attr(type), type, NULL);
+}
+
+static void
+menu_putline(int index, const struct menu_item *item, bool selected)
+{
+ WINDOW *win = menu.win;
+ bool hotkeys = menu.hotkeys;
+ if (hotkeys) {
+ if (item->hotkey)
+ mvwprintw(win, index+1, 2, "[%c] %s", (char) item->hotkey, item->text);
+ else
+ mvwprintw(win, index+1, 6, "%s", item->text);
+ } else {
+ mvwprintw(win, index+1, 2, "%s", item->text);
+ }
+ if (selected)
+ menu_set_line_attr(index, LINE_CURSOR);
+}
+