-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.c
More file actions
54 lines (49 loc) · 1.4 KB
/
Copy pathbutton.c
File metadata and controls
54 lines (49 loc) · 1.4 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "button.h"
extern FILE *fp;
wwButton* wwButton_Create(wwWindowAndRenderer *windowAndRenderer, wchar_t *text, int x, int y, int width, int height)
{
wwButton *button = (wwButton*) malloc(sizeof(wwButton));
if(windowAndRenderer->buttons == NULL)
{
windowAndRenderer->buttons = wwList_CreateEmpty(sizeof(wwButton), TRUE, wwWidget_FreeFunc);
}
wwWidget_Create(&button->widget, text, x, y, width, height);
wwList_Append(windowAndRenderer->buttons, button);
return button;
}
void wwButton_SetCallback(wwButton *button, wwButtonCallback callback, void *userData)
{
wwWidget_SetCallback((wwWidget*) button, (wwWidgetCallback) callback, userData);
}
void wwButton_SetText(wwButton *button, wchar_t *text)
{
wwWidget_SetText(&button->widget, text);
}
void wwButton_SetX(wwButton *button, int x)
{
wwWidget_SetX(&button->widget, x);
}
void wwButton_SetY(wwButton *button, int y)
{
wwWidget_SetY(&button->widget, y);
}
void wwButton_SetWidth(wwButton *button, int width)
{
wwWidget_SetWidth(&button->widget, width);
}
void wwButton_SetHeight(wwButton *button, int height)
{
wwWidget_SetHeight(&button->widget, height);
}
wchar_t* wwButton_GetText(wwButton *button)
{
return wwWidget_GetText(&button->widget);
}
void wwButton_SetColor(wwButton *button, wwColor color)
{
return;
}
unsigned short wwButton_GetId(wwButton *button)
{
return button->widget.id;
}