gokernel
(usa Linux Mint)
Enviado em 15/03/2014 - 09:52h
Olá !!!
Os colegas acima já responderam a sua petgunta ...
Mas se quiser ver também essa minha API( GUI ) beta veja:
http://sourceforge.net/projects/campusapi/
Um pequeno exemplo:
//-------------------------------------------------------------------
//
// CAMPUS Framework simple test using SDL.
//
// FILE:
// basic.c
//
// COMPILE:
// gcc basic.c -o basic libcampus.a -lSDL -Wall
//
// BY: gokernel - gokernel@hotmail.com
//
//-------------------------------------------------------------------
#include "campus.h"
OBJECT win, button;
int count;
int call_button (OBJECT o, int ev, int key)
{
if (ev == EV_CLICK)
{
printf ("Hello World: %d\n", count++);
return RET_REDRAW_ME;
}
return 0;
}
int main (int argc, char *argv[])
{
camInit (argc, argv);
win = camNewWindow (
150, 100, 320, 240, // rect: x, y, w, h
0, 0, WF_FULL, // id, key, flags
NULL, // call
NULL, // parent
//------- data -------
"FIRST WINDOW: container + button", // text
COL_BG // bg
);
button = camNewButton (
100, 100, 120, 30, // rect: x, y, w, h
0, 0, 0, // id, key, flags
call_button, // call
win, // parent
//------- data -------
"Hello World" // text
);
camRun (); // main loop
printf ("\nExiting with sucess !!!\n");
return 0;
}
Configurado para compilação com SDL:
------------------------------------
#define TAG_SDL
------------------------------------
Para compilar a API:
make clean
make