summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAdam NAILI2017-12-10 13:01:42 +0100
committerAdam NAILI2017-12-10 13:01:42 +0100
commit2aed52d89856847ea394b06d7b70782fa6b21d24 (patch)
tree1ae887ae79605f51d0f71a38a808fdb58867d58b /src/gui
parent6e91c1be2b0abddb6cfe16152b35cd0559b83c4a (diff)
downloadmorpher-2aed52d89856847ea394b06d7b70782fa6b21d24.tar.gz
Implementing init, free, add_button, add_pictureframe functions for window
Diffstat (limited to 'src/gui')
-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