#include <stdio.h>
#include "graphapp.h"
void redraw_it(Window *w, Graphics *g)
{
Rect r = rect(10,10,80,10);
set_colour(g, RED);
draw_rect(g, r);
set_colour(g, BLUE);
fill_rect(g, rect(10,40,80,10));
}
int main(int argc, char *argv[])
{
App *app = new_app(argc, argv);
Window *w = new_window(app, rect(0,0,174,100),
"Graphics", STANDARD_WINDOW);
on_window_redraw(w, redraw_it);
show_window(w);
main_loop(app);
return 0;
}
Notes: