6 WINDOW* create_list_win(int height, int width, int y, int x);
9 main(int argc, char** argv)
15 char* todos[] = {"eat bread", "eat milk", "eat cheese"};
28 getmaxyx(stdscr, height, width);
31 /* init todo menu stuff */
33 todo_win = create_list_win(20, 40, 5, 5);
34 todo_length = sizeof(todos)/sizeof(todos[0]);
36 todo_items = malloc((todo_length+1)*sizeof(ITEM*));
37 for (int i = 0; i < todo_length; i++) {
38 todo_items[i] = new_item(todos[i], "");
40 todo_items[todo_length] = NULL; // last item needs to be a null pointer for some reason?
42 todo_menu = new_menu(todo_items);
45 /* todo_menu = new_menu(); */
47 /* for (int i = 0; i < todo_length; i++) { */
48 /* mvwprintw(todo_win, i, 0, todos[i]); */
52 while ((ch = getch()) != 113) { // while not q
54 // ofc the first thing we need is vim keys
57 menu_driver(todo_menu, REQ_DOWN_ITEM);
60 menu_driver(todo_menu, REQ_UP_ITEM);
74 create_list_win(int height, int width, int y, int x)
76 WINDOW* new_win = newwin(height, width, y, x);