blob: 6e0e263012e06d793b8953f3e3bbb8dcf6b5dd79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <glib.h>
#include "button.h"
Button *button_create(const char *text, bool fixed_size)
{
Button *btn = g_malloc0(sizeof(Button));
btn->text = g_strdup(text);
btn->fixed_size = fixed_size;
return btn;
}
void button_set_action(Button *btn, ButtonAction action)
{
btn->action = action;
}
void button_destroy(Button *btn)
{
g_free(btn->text);
g_free(btn);
}
|