dorne/cli/main.c

46 lines
902 B
C

#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <ncursesw/ncurses.h>
// #include "child.h"
#include "curse.h"
#include "tree.h"
// struct d_window {
// int ptmx; // fd
// };
// struct d_window new_window() {
// struct d_window w = {
// .ptmx = posix_openpt(O_RDWR | O_NOCTTY),
// };
// }
int main(int argc, char **argv) {
// struct d_child child;
// spawnchild(&child);
struct crs_tree *tree;
ct_init(&tree);
init_pair(1, COLOR_CYAN, COLOR_CYAN);
init_pair(2, COLOR_RED, COLOR_RED);
bifurcate_window_node(&tree->root, AXIS_X, FALSE, 0.5);
wbkgd(tree->root->child[0]->win, COLOR_PAIR(1));
wbkgd(tree->root->child[1]->win, COLOR_PAIR(2));
wrefresh(tree->root->child[0]->win);
wrefresh(tree->root->child[1]->win);
while (1) {
ct_update(tree);
// refresh();
// usleep(100000);
}
destroy_tree(tree);
return EXIT_SUCCESS;
}