- int flag;
- FILE* board_file;
- char** todos;
- int todo_length;
- int height, width;
- int x, y;
- int ch;
- WINDOW* todo_win;
-
- signal(SIGWINCH, winch_handler);
-
- // read command line args
- flag = getopt(argc, argv, "o:n:");
- switch (flag) {
- case 'o':
-
- // read from task file (might need to check for read and write permissions)
- board_file = fopen(optarg, "r");
- if (!board_file) {
- printf("%s does not exist\n", optarg);
- return 1;
- }
-
- todos = read_todo(board_file, &todo_length);
- fclose(board_file);
-
- break;
-
- case 'n':
-
- // make sure file does not exist
- // however, it maybe be possible that an different error has occured (besides the file not existing)
- if (access(optarg, F_OK) == 0) {
- printf("%s already exists\n", optarg);
- return 1;
- }
- // create a file here
- board_file = fopen(optarg, "w");
- // write init stuff here
- fclose(board_file);
- printf("Successfully created %s\n", optarg);
-
- todos = malloc(0);
- todo_length = 0;
-
- break;
-
- case -1:
- case '?':
- printf("Help string\n");
- return 2;
- }
-
+ char ch;
+ /* Board* board; */
+ /* board = begin_parse("test_board.md"); */
+ /* log_todo(board); */
+
+ /* init curses */
+ init_tscurses();
+
+ MenuItem** item_list = malloc(5*sizeof(MenuItem*));
+ item_list[0] = create_menuitem("Many of you are probably feeling a little sad.");
+ item_list[1] = create_menuitem("This is ok. Sadness is a normal human emotion.");
+ item_list[2] = create_menuitem("I encourage you to watch the movie Inside Out");
+ item_list[3] = create_menuitem("one of the best movies of all time.");
+ item_list[4] = 0;
+
+ Menu* menu = create_menu(item_list);
+ WINDOW* win = newwin(20, 40, 5, 5);
+ set_menu_win(menu, win);
+ set_menu_focus(menu, true);
+ box(win, 0, 0);
+ refresh();
+ wrefresh(win);