summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/window.c27
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
3void window_init(Window *window, int width, int height, char *title) { 7void 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
7void window_free(Window *window) { 19void window_free(Window *window) {
8//TODO 20 group_free(window->group_buttons);
21 group_free(window->group_pictureframe);
9} 22}
10 23
11void window_add_component(Window *window, Component *component) { 24void window_add_button(Window *window, Component *component){
12//TODO 25 group_add_component(window->group_buttons,component);
13} 26}
27
28void window_add_pictureframe(Window *window, Component *component){
29 group_add_component(window->group_pictureframe,component);
30} \ No newline at end of file