GSoC/GCI Archive
Google Code-in 2010 Tux4Kids

Simple C+SDL Menu for TuxHistory

completed by: Aviral Dasgupta

mentors: Jesus Manuel Mager Hois

Write simple menu for TuxHistory in C+SDL, that uses mouse and colored surfaces, with the following dynamic elements:

  •   Button element
  •   Container vector
  •   Window element

The menu should be compilabe only with SDL libraries in GCC. It dont need a special automake configuration. Only the .c/.h files of the mini library and a concrete example are needed.

It should be some thing like this:

 


#include "thgui.h"

 

...
th_win *win;
th_grid *grid;
th_button *button;
th_button *button2;

//to init


win = th_new_win("title", &SDL_Rect);

grid = th_new_grid(rows);

button = th_create("name", linked_func);

button2 = th_create("name", linked_func2);

th_grid_add(button);

th_grid_add(button2);

th_win_add(grid);

...
// to draw

th_draw(win);


// to eval


th_eval(win);