summaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-06-30 10:57:04 -0700
committerLouie S <louie@example.com>2023-06-30 10:57:04 -0700
commit33e27b2c2796aa98fb7e48079187b01a2e59d72a (patch)
treed93fec7bc0e0c84716792217de456137901205f9 /src/draw.c
parent4333cd2b11cc32fe75fa1ef31627c667bcc71327 (diff)
draw skeleton
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/draw.c b/src/draw.c
new file mode 100644
index 0000000..75d4dbe
--- /dev/null
+++ b/src/draw.c
@@ -0,0 +1,23 @@
+#include <curses.h>
+#include <signal.h>
+
+#include "draw.h"
+
+void tui_init() {
+ int input; // capture user input
+
+ // set an interrupt to end cleanly
+ signal(SIGINT, tui_end);
+
+ // init and set options
+ initscr();
+ keypad(stdscr, TRUE); // enable arrow keys and other function keys
+ cbreak(); // set for interactive curses applications
+
+ input = getch();
+ tui_end();
+}
+
+void tui_end() {
+ endwin();
+}