bit more messing around
[taskasaur.git] / main.cpp
1 #include <ncurses.h>
2 #include <string>
3 using namespace std;
4
5 int main(int argc, char ** argv) {
6     
7     initscr();
8     cbreak();
9     /* raw(); */
10     noecho();
11     start_color();
12     
13     init_pair(1, COLOR_CYAN, COLOR_BLACK); 
14     init_pair(2, COLOR_BLACK, COLOR_CYAN); 
15
16     int height, width;
17     getmaxyx(stdscr, height, width);
18
19     WINDOW * win = newwin(10,20,5,10); 
20     WINDOW * todo_win = newwin(20,20,5,35);
21     WINDOW * bottombar = newwin(1,width,height-1,0); 
22     refresh();
23     
24     int x, y;
25     x = y = 0;
26
27     string todo_list[3] = {"Contemplate life", "Question life", "Ponder about life"};
28
29     while (true) {
30         int ch = getch();
31         
32         //ofc the first thing we need is vim keys 
33         switch (ch) {
34             case 104: // h
35                 x -= 1;
36                 break;
37             case 106: // j
38                 y += 1;
39                 break;
40             case 107: // k
41                 y -= 1;
42                 break;
43             case 108: // l
44                 x += 1;
45                 break;
46         } 
47         if (ch == 113) break; // q for quit
48
49
50         box(win, 0, 0);
51         wattron(win,COLOR_PAIR(1));
52         wattron(win, A_BOLD);
53         mvwprintw(win, 0, 1, "lmao");
54         wattroff(win, A_BOLD);
55         wattroff(win,COLOR_PAIR(1));
56         mvwprintw(win, 1, 2, "poopoopeepee");
57         wrefresh(win);
58
59         for (int i = 0; i < sizeof(todo_list)/sizeof(string); i++) {
60             mvwprintw(todo_win, 2*i, 0, todo_list[i].c_str());
61         }
62         wrefresh(todo_win);
63
64         wbkgd(bottombar, COLOR_PAIR(2));        
65         mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");
66         wrefresh(bottombar);
67
68         move(y,x);
69         refresh();
70         /* clear(); */
71     }
72
73     endwin();
74
75     return 0;
76 }
77
78