aboutsummaryrefslogtreecommitdiff
path: root/src/mgui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mgui/widget.c')
-rw-r--r--src/mgui/widget.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mgui/widget.c b/src/mgui/widget.c
index e9c8425..8a49715 100644
--- a/src/mgui/widget.c
+++ b/src/mgui/widget.c
@@ -3,6 +3,7 @@
#include "../../include/mgui/scrollview.h"
#include "../../include/mgui/button.h"
#include "../../include/mgui/label.h"
+#include "../../include/mgui/richtext.h"
#include "../../include/mgui/image.h"
/* TODO: Use margin */
@@ -33,6 +34,9 @@ void mgui_widget_set_position(mgui_widget *self, mgl_vec2i position) {
case MGUI_WIDGET_LABEL:
mgui_label_set_position(mgui_widget_to_label(self), position);
break;
+ case MGUI_WIDGET_RICHTEXT:
+ mgui_richtext_set_position(mgui_widget_to_richtext(self), position);
+ break;
case MGUI_WIDGET_IMAGE:
mgui_image_set_position(mgui_widget_to_image(self), position);
break;
@@ -53,6 +57,9 @@ void mgui_widget_set_width(mgui_widget *self, int width) {
case MGUI_WIDGET_LABEL:
mgui_label_set_width(mgui_widget_to_label(self), width);
break;
+ case MGUI_WIDGET_RICHTEXT:
+ mgui_richtext_set_width(mgui_widget_to_richtext(self), width);
+ break;
case MGUI_WIDGET_IMAGE:
mgui_image_set_width(mgui_widget_to_image(self), width);
break;
@@ -73,6 +80,9 @@ void mgui_widget_on_event(mgui_widget *self, mgl_window *window, mgl_event *even
case MGUI_WIDGET_LABEL:
mgui_label_on_event(mgui_widget_to_label(self), window, event);
break;
+ case MGUI_WIDGET_RICHTEXT:
+ mgui_richtext_on_event(mgui_widget_to_richtext(self), window, event);
+ break;
case MGUI_WIDGET_IMAGE:
mgui_image_on_event(mgui_widget_to_image(self), window, event);
break;
@@ -89,6 +99,8 @@ mgl_vec2i mgui_widget_draw(mgui_widget *self, mgl_window *window) {
return mgui_button_draw(mgui_widget_to_button(self), window);
case MGUI_WIDGET_LABEL:
return mgui_label_draw(mgui_widget_to_label(self), window);
+ case MGUI_WIDGET_RICHTEXT:
+ return mgui_richtext_draw(mgui_widget_to_richtext(self), window);
case MGUI_WIDGET_IMAGE:
return mgui_image_draw(mgui_widget_to_image(self), window);
}