aboutsummaryrefslogtreecommitdiff
path: root/include/mgui/button.h
blob: d9e87839001e413eb08f53b33c5d735b711453a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef MGUI_BUTTON_H
#define MGUI_BUTTON_H

#include "widget.h"
#include <mgl/graphics/rectangle.h>
#include <mgl/graphics/text.h>

typedef struct {
    mgui_widget widget;
    mgl_rectangle background;
    mgl_text text;
} mgui_button;

mgui_button* mgui_button_create();
mgui_widget* mgui_button_to_widget(mgui_button *list);
mgui_button* mgui_widget_to_button(mgui_widget *widget);

void mgui_button_set_position(mgui_button *self, mgl_vec2i position);
void mgui_button_set_width(mgui_button *self, int width);
void mgui_button_on_event(mgui_button *self, mgl_window *window, mgl_event *event);
/* Returns the size of the widget */
mgl_vec2i mgui_button_draw(mgui_button *self, mgl_window *window);

#endif /* MGUI_BUTTON_H */