From ee98053ef83869033713c8c7d6d487457d6443d8 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 27 Dec 2017 17:16:20 +0100 Subject: Implementing the locking system to disable components --- src/gui/group.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/group.c') diff --git a/src/gui/group.c b/src/gui/group.c index d287205..11a0583 100644 --- a/src/gui/group.c +++ b/src/gui/group.c @@ -21,7 +21,8 @@ void group_print(Component *parameterSelf) { void group_click_handler(int x_pos, int y_pos, Component *parameterSelf) { assert(parameterSelf != NULL); Group *self = (Group *) parameterSelf; - if (self->group_head != NULL) { + + if (self->group_head != NULL && self->component.activated) { GroupElement *p = self->group_head; while (p != NULL) { p->sub_component->click_handler(x_pos, y_pos, p->sub_component); @@ -41,6 +42,7 @@ void group_init(Group *group, int width, int height, int x_pos, int y_pos, int m group->component.height = height; group->component.x_pos = x_pos; group->component.y_pos = y_pos; + group->component.activated = true; group->component.print_method = group_print; group->component.click_handler = group_click_handler; group->margin = margin; -- cgit v1.2.3