-MENU*
-create_todo_menu(WINDOW* win, char** todo_list, int todo_length)
-{
- MENU* todo_menu;
- ITEM** item_list;
- ITEM* cur_item;
- int wheight, wwidth;
-
- item_list = malloc((todo_length+1)*sizeof(ITEM*));
- for (int i = 0; i < todo_length; i++) {
- item_list[i] = new_item(todo_list[i], "");
- set_item_userptr(item_list[i], on_select);
- }
- item_list[todo_length] = NULL; // last item needs to be a null pointer for some reason?
-
- todo_menu = new_menu(item_list);
-
- getmaxyx(win, wheight, wwidth);
- set_menu_win(todo_menu, win);
- set_menu_sub(todo_menu, derwin(win, wheight-2, wwidth-2, 1, 2));
- set_menu_mark(todo_menu, "");
- set_menu_spacing(todo_menu, 1, 2, 1);
- set_menu_fore(todo_menu, COLOR_PAIR(SELECTED_COLOR));
- set_menu_back(todo_menu, COLOR_PAIR(NON_SELECTED_COLOR));
-
- box(win, 0, 0); //temp
-
- return todo_menu;
-}
-
-void
-on_select(char *item)
-{
- printf("lol");
-}
-
-void
-free_todo(char** todo_list, int todo_length)
-{
- // probably check if list is too short or too long
- for (int i = 0; i < todo_length; i++) {
- free(todo_list[i]);
- }
- free(todo_list);
-}