(UNDER CONSTRUCTION) fixed bad free + testing AXIS_X bifurcation

This commit is contained in:
Emile Clark-Boman 2025-09-16 18:46:01 +10:00
parent b16590fd5a
commit 5e99b09f8a
7 changed files with 92 additions and 46 deletions

View file

@ -10,15 +10,34 @@ int main(int argc, char **argv) {
struct ct_tree *tree;
ct_init(&tree);
init_pair(1, COLOR_CYAN, COLOR_CYAN);
init_pair(2, COLOR_RED, COLOR_RED);
init_pair(1, COLOR_BLACK, COLOR_CYAN);
init_pair(2, COLOR_BLACK, COLOR_RED);
// wbkgd(tree->root->win, COLOR_PAIR(1));
// wrefresh(tree->root->win);
int i = 1;
while (1) {
// wbkgd(tree->root->surface->win, COLOR_PAIR(1));
// wrefresh(tree->root->surface->win);
struct ct_node *const child1 = new_node(bounds_none(), tree->root);
struct ct_node *const child2 = new_node(bounds_none(), tree->root);
append_child_node(tree->root, child1);
append_child_node(tree->root, child2);
wbkgd(child1->surface->win, COLOR_PAIR(1));
wbkgd(child2->surface->win, COLOR_PAIR(2));
// wrefresh(child1->surface->win);
mvwprintw(child2->surface->win, 0, 0, "1@(%d,%d) %dx%d\n",
child1->surface->dims->x, child1->surface->dims->y,
child1->surface->dims->width, child1->surface->dims->height);
mvwprintw(child2->surface->win, 1, 0, "2@(%d,%d) %dx%d\n",
child2->surface->dims->x, child2->surface->dims->y,
child2->surface->dims->width, child2->surface->dims->height);
wrefresh(child2->surface->win);
while (1) {
ct_update(tree);
napms(100);
}
destroy_tree(tree);