#include <stdio.h>
#include "graphapp.h"
Rect r;
Window *w;
void draw_something(Timer *t)
{
Graphics *g = get_window_graphics(w);
draw_ellipse(g, r);
r.x += 10;
r.y += 10;
del_graphics(g);
}
int main(int argc, char *argv[])
{
App *app;
Timer *t;
app = new_app(argc, argv);
w = new_window(app, rect(20,20,400,300), "Timer", STANDARD_WINDOW);
show_window(w);
r = rect(10,10,30,15);
t = new_timer(app, draw_something, 2000);
draw_something(t);
main_loop(app);
return 0;
}
Notes: