Programming with GraphApp
Hello World:
#include <stdio.h>
#include "graphapp.h"
int main(int argc, char *argv[])
{
App *app = new_app(argc, argv);
Window *w = new_window(app,
rect(0,0,240,160),
"Graphics",
STANDARD_WINDOW);
new_label(w, rect(0,0,100,30),
"Hello world", ALIGN_LEFT);
show_window(w);
main_loop(app);
return 0;
}
Notes:
- You need an App and a Window to begin.
- Use new_app to make an App data structure.
- Use new_window to make a Window data structure.
- The rect function is used to specify a rectangle in pixels.
- A label is some text stuck to the window's surface.
- Windows are invisible at first. Make them visible with show_window.
- The main_loop function handles events for you.