diff options
-rw-r--r-- | src/gui/window.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/gui/window.c b/src/gui/window.c index 2b4c7e0..bd96050 100644 --- a/src/gui/window.c +++ b/src/gui/window.c | |||
@@ -1,13 +1,30 @@ | |||
1 | #include "gui/window.h" | 1 | #include <stdlib.h> |
2 | #include <gui/window.h> | ||
3 | #include <common/mem.h> | ||
4 | #include "string.h" | ||
5 | #include "assert.h" | ||
2 | 6 | ||
3 | void window_init(Window *window, int width, int height, char *title) { | 7 | void window_init(Window *window, int width, int height, char *title) { |
4 | //TODO | 8 | window = malloc_or_die(sizeof(window)); |
9 | assert(width > 0); | ||
10 | assert(height > 0); | ||
11 | window->width = width; | ||
12 | window->height = height; | ||
13 | assert(title != NULL); | ||
14 | strcpy(window->title,title); | ||
15 | window->group_buttons = malloc_or_die(sizeof(Group)); | ||
16 | window->group_pictureframe = malloc_or_die(sizeof(Group)); | ||
5 | } | 17 | } |
6 | 18 | ||
7 | void window_free(Window *window) { | 19 | void window_free(Window *window) { |
8 | //TODO | 20 | group_free(window->group_buttons); |
21 | group_free(window->group_pictureframe); | ||
9 | } | 22 | } |
10 | 23 | ||
11 | void window_add_component(Window *window, Component *component) { | 24 | void window_add_button(Window *window, Component *component){ |
12 | //TODO | 25 | group_add_component(window->group_buttons,component); |
13 | } | 26 | } |
27 | |||
28 | void window_add_pictureframe(Window *window, Component *component){ | ||
29 | group_add_component(window->group_pictureframe,component); | ||
30 | } \ No newline at end of file | ||