-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbasic.c
42 lines (36 loc) · 832 Bytes
/
basic.c
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
//-------------------------------------------------------------------
//
// Basic Example:
//
// FILE:
// basic.c
//
// COMPILE:
// gcc basic.c -o basic libapp.a -lSDL -Wall
//
//-------------------------------------------------------------------
//
#include "src/app.h"
#define ID_BUTTON 1000
OBJECT *zero = NULL;
OBJECT *button;
int count;
void call_button (int msg) {
printf ("Count: %d\n", count++);
}
void CreateInterface (void) {
zero = app_GetRoot ();
if (zero) {
button = app_NewButton (zero, ID_BUTTON, 100, 100, "Hello");
if (button) {
app_SetCall (button, call_button);
}
}
}
int main (int argc, char **argv) {
if (app_Init(argc,argv)) {
CreateInterface();
app_Run (NULL);
}
return 0;
}