3 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 zgui_puts (10, 10, "ZCalc", 0);
32 sprintf (res
, "= %d", result
);
34 zgui_puts (10, 20, res
, 0);
38 btn
[1] = zgui_button (10, 100, "1");
39 btn
[2] = zgui_button (35, 100, "2");
40 btn
[3] = zgui_button (60, 100, "3");
41 btn
[12] = zgui_button (85, 100, "*");
43 btn
[4] = zgui_button (10, 75, "4");
44 btn
[5] = zgui_button (35, 75, "5");
45 btn
[6] = zgui_button (60, 75, "6");
46 btn
[13] = zgui_button (85, 75, "/");
48 btn
[7] = zgui_button (10, 50, "7");
49 btn
[8] = zgui_button (35, 50, "8");
50 btn
[9] = zgui_button (60, 50, "9");
51 btn
[15] = zgui_button (85, 50, "C");
53 btn
[0] = zgui_button (10, 125, "0");
54 btn
[10] = zgui_button (35, 125, "+");
55 btn
[11] = zgui_button (60, 125, "-");
56 btn
[14] = zgui_button (85, 125, "=");
59 for (i
= 0; i
< 10; i
++)
137 int main (int argc
, char **argv
)
146 if (zgui_init () == -1)
149 zgui_resize (120, 200);
152 unsigned state
= zgui_event ();
154 if (state
& APPCL_STATE_REDRAW
)
157 if (state
& APPCL_STATE_EXIT
)