Seperated chart from box; fixed kkr segfault.

This commit is contained in:
2025-10-18 19:21:22 +02:00
parent c7f218da30
commit 65a1c9f159
8 changed files with 80 additions and 43 deletions

18
box.h
View File

@@ -8,6 +8,7 @@
#pragma once
#include "chart.h"
#include "ui.h"
@@ -27,18 +28,13 @@ struct box {
/* button */
char *name;
/* chart and vertical/horizontal box */
/* chart */
struct chart *chart;
/* vertical/horizontal */
struct {
/* chart and vertical/horizontal box */
size_t length;
union {
/* vertical/horizontal box */
struct box **children;
/* chart */
double *prices;
};
struct box **children;
};
};
};
@@ -47,7 +43,7 @@ struct box {
struct box *new_button_box(char *name);
struct box *new_vertical_box(void);
struct box *new_horizontal_box(void);
struct box *new_chart_box(void);
struct box *new_chart_box(struct chart *);
void append_box(struct box *parent, struct box *child);