diff options
author | Adam NAILI | 2017-12-12 13:18:22 +0100 |
---|---|---|
committer | Adam NAILI | 2017-12-12 13:18:22 +0100 |
commit | e96c998be9e867e328d393966a60599dc3c37e3a (patch) | |
tree | 2e5bec8a43c896083defce280713a85efc00eb82 /src/gui/window.c | |
parent | 26bb3df365ed43dd415be8ac870da8ac8991b425 (diff) | |
download | morpher-e96c998be9e867e328d393966a60599dc3c37e3a.tar.gz |
Adding asserts, fixing the call of group_init that changed
Diffstat (limited to 'src/gui/window.c')
-rw-r--r-- | src/gui/window.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/window.c b/src/gui/window.c index 81af66a..7b5a75f 100644 --- a/src/gui/window.c +++ b/src/gui/window.c | |||
@@ -1,5 +1,7 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include <gui/window.h> | 2 | #include <gui/window.h> |
3 | #include <gui/group.h> | ||
4 | #include <gui/component.h> | ||
3 | #include "gui/window.h" | 5 | #include "gui/window.h" |
4 | #include "common/mem.h" | 6 | #include "common/mem.h" |
5 | #include "string.h" | 7 | #include "string.h" |
@@ -7,6 +9,7 @@ | |||
7 | #include "MLV/MLV_window.h" | 9 | #include "MLV/MLV_window.h" |
8 | 10 | ||
9 | void window_init(Window *window, int width, int height, char *title) { | 11 | void window_init(Window *window, int width, int height, char *title) { |
12 | assert(window != NULL); | ||
10 | assert(width > 0); | 13 | assert(width > 0); |
11 | assert(height > 0); | 14 | assert(height > 0); |
12 | window->width = width; | 15 | window->width = width; |
@@ -15,9 +18,9 @@ void window_init(Window *window, int width, int height, char *title) { | |||
15 | window->title = malloc_or_die(sizeof(char) * (strlen(title) + 1)); | 18 | window->title = malloc_or_die(sizeof(char) * (strlen(title) + 1)); |
16 | strcpy(window->title, title); | 19 | strcpy(window->title, title); |
17 | window->group_buttons = malloc_or_die(sizeof(Group)); | 20 | window->group_buttons = malloc_or_die(sizeof(Group)); |
18 | group_init(window->group_buttons, 5); | 21 | group_init(window->group_buttons,window->width,100,0,window->height-100,5); |
19 | window->group_pictureframe = malloc_or_die(sizeof(Group)); | 22 | window->group_pictureframe = malloc_or_die(sizeof(Group)); |
20 | group_init(window->group_pictureframe, 5); | 23 | group_init(window->group_pictureframe,window->width,window->height-100,0,0,5); |
21 | } | 24 | } |
22 | 25 | ||
23 | void window_free(Window *window) { | 26 | void window_free(Window *window) { |