aboutsummaryrefslogtreecommitdiff
path: root/src/button.c
blob: b2155ed76aea0ca062d54dfbe3b8a6520fa90cdd (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
25
26
27
28
29
#include <glib.h>

#include "button.h"

Button *button_create(const char *text, PangoAlignment align)
{
	Button *btn = g_malloc0(sizeof(Button));
	btn->text = g_strdup(text);
	btn->align = align;
	return btn;
}

void button_set_colors(Button *btn, Color background, Color foreground, Color stroke)
{
	btn->background = background;
	btn->foreground = foreground;
	btn->stroke = stroke;
}

void button_set_action(Button *btn, ButtonAction action)
{
	btn->action = action;
}

void button_destroy(Button *btn)
{
	g_free(btn->text);
	g_free(btn);
}