pinosaur
/
taskasaur.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f6efe7
)
bit more messing around
author
Daniel Liu
<mr.picklepinosaur@gmail.com>
Thu, 3 Dec 2020 02:50:08 +0000
(21:50 -0500)
committer
Daniel Liu
<mr.picklepinosaur@gmail.com>
Thu, 3 Dec 2020 02:50:08 +0000
(21:50 -0500)
main.cpp
patch
|
blob
|
history
diff --git
a/main.cpp
b/main.cpp
index
7757262
..
791d86e
100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-1,4
+1,5
@@
#include <ncurses.h>
#include <ncurses.h>
+#include <string>
using namespace std;
int main(int argc, char ** argv) {
using namespace std;
int main(int argc, char ** argv) {
@@
-7,14
+8,24
@@
int main(int argc, char ** argv) {
cbreak();
/* raw(); */
noecho();
cbreak();
/* raw(); */
noecho();
+ start_color();
- WINDOW * win = newwin(10,20,10,10);
-
+ init_pair(1, COLOR_CYAN, COLOR_BLACK);
+ init_pair(2, COLOR_BLACK, COLOR_CYAN);
+
+ int height, width;
+ getmaxyx(stdscr, height, width);
+
+ WINDOW * win = newwin(10,20,5,10);
+ WINDOW * todo_win = newwin(20,20,5,35);
+ WINDOW * bottombar = newwin(1,width,height-1,0);
refresh();
int x, y;
x = y = 0;
refresh();
int x, y;
x = y = 0;
+ string todo_list[3] = {"Contemplate life", "Question life", "Ponder about life"};
+
while (true) {
int ch = getch();
while (true) {
int ch = getch();
@@
-35,12
+46,26
@@
int main(int argc, char ** argv) {
}
if (ch == 113) break; // q for quit
}
if (ch == 113) break; // q for quit
- move(y,x);
box(win, 0, 0);
box(win, 0, 0);
+ wattron(win,COLOR_PAIR(1));
+ wattron(win, A_BOLD);
mvwprintw(win, 0, 1, "lmao");
mvwprintw(win, 0, 1, "lmao");
+ wattroff(win, A_BOLD);
+ wattroff(win,COLOR_PAIR(1));
+ mvwprintw(win, 1, 2, "poopoopeepee");
wrefresh(win);
wrefresh(win);
+ for (int i = 0; i < sizeof(todo_list)/sizeof(string); i++) {
+ mvwprintw(todo_win, 2*i, 0, todo_list[i].c_str());
+ }
+ wrefresh(todo_win);
+
+ wbkgd(bottombar, COLOR_PAIR(2));
+ mvwprintw(bottombar, 0, 2, "BOTTOM TEXT");
+ wrefresh(bottombar);
+
+ move(y,x);
refresh();
/* clear(); */
}
refresh();
/* clear(); */
}