test standard ncurses graphing template

This commit is contained in:
Emile Clark-Boman 2025-09-09 11:26:27 +10:00
parent 342886a098
commit 5a4f75c418
2 changed files with 60 additions and 0 deletions

54
lib/graph.c Normal file
View file

@ -0,0 +1,54 @@
#include <ncurses.h>
// void init_colors() {
// start_color();
// init_pair(1, COLOR_GREEN, COLOR_BLACK);
// init_pair(2, COLOR_CYAN, COLOR_BLACK);
// init_pair(3, COLOR_MAGENTA, COLOR_BLACK);
// init_pair(4, COLOR_YELLOW, COLOR_BLACK);
// }
// int main(void) {
// initscr();
// printw("Goodbye World...");
// refresh();
// getch();
// endwin();
// return 0;
// }
int main(void) {
initscr();
raw();
// cbreak();
// noecho();
// echo();
// curs_set(0);
keypad(stdscr, TRUE); // enable F1, F2, etc
noecho();
// nodelay(stdscr, TRUE);
// getmaxyx(stdscr, max_y, max_x);
// init_colors();
printw("Type: ");
refresh();
int ch;
while (1) {
ch = getch();
if (ch == KEY_F(1)) {
printw("[!] F1\n");
break;
}
attron(A_BOLD);
printw("%c", ch);
attroff(A_BOLD);
refresh();
// napms(50);
}
endwin();
return 0;
}

6
lib/graph.h Normal file
View file

@ -0,0 +1,6 @@
#ifndef DORNE_GRAPH_H
#define DORNE_GRAPH_H
#endif /* DORNE_GRAPH_H */