+
+int
+render_menu(Menu* menu)
+{
+ int cur_line;
+
+ cur_line = 0;
+
+ for (int i = 0; i < menu->menu_length; i++) {
+
+ int wrapped_lines;
+ char* wrapped_text;
+ int text_color;
+
+ /* wrap text by inserting newlines */
+ wrapped_text = wrap_text(menu->menu_items[i]->contents, menu->max_width, &wrapped_lines);
+
+ /* color selected item */
+ text_color = (i == menu->selected_item) ? TS_SELECTED : TS_NONSELECTED;
+
+ wattron(menu->menu_win, COLOR_PAIR(text_color));
+ mvwprintw(menu->menu_win, cur_line, 0, wrapped_text);
+ wattroff(menu->menu_win, COLOR_PAIR(text_color));
+
+ cur_line += wrapped_lines;
+
+ free(wrapped_text);
+
+ }
+
+ return 0;
+}
+
+int
+free_menu(Menu* menu)
+{
+ return 0;
+}
+