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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mgui/widget.c b/src/mgui/widget.c
index f35ff05..195d253 100644
--- a/src/mgui/widget.c
+++ b/src/mgui/widget.c
@@ -25,6 +25,17 @@ void mgui_widget_set_position(mgui_widget *self, mgl_vec2i position) {
}
}
+void mgui_widget_set_width(mgui_widget *self, int width) {
+ switch(self->type) {
+ case MGUI_WIDGET_LIST:
+ mgui_list_set_width(mgui_widget_to_list(self), width);
+ break;
+ case MGUI_WIDGET_BUTTON:
+ mgui_button_set_width(mgui_widget_to_button(self), width);
+ break;
+ }
+}
+
void mgui_widget_on_event(mgui_widget *self, mgl_window *window, mgl_event *event) {
switch(self->type) {
case MGUI_WIDGET_LIST: