>>102105282
what exactly do you need in your window?
just a couple of buttons? or some more complex widgets?
#include <dg/core/core.h>
#include <dg/base/base.h>
#include <stdlib.h>
#include <string.h>
#define MSG "Click me"
static dg_core_window_t *_w = NULL;
static dg_core_grid_t *_g = NULL;
static dg_core_cell_t *_c = NULL;
static void
_click(dg_core_cell_t *c)
{
printf("button clicked\n");
}
int
main(int argc, char **argv)
{
/* module initialisation */
dg_core_init(argc, argv, NULL, NULL, NULL);
dg_base_init();
/* object instantiation */
_w = dg_core_window_create(DG_CORE_WINDOW_DEFAULT);
_g = dg_core_grid_create(1, 1);
_c = dg_base_button_create();
/* button configuration */
dg_base_button_set_label(_c, MSG);
dg_base_button_set_callback_pressed(_c, _click);
/* grid configuration */
dg_core_grid_set_column_width(_g, 0, strlen(MSG));
dg_core_grid_set_column_growth(_g, 0, 1.0);
dg_core_grid_set_row_growth(_g, 0, 1.0);
dg_core_grid_assign_cell(_g, _c, 0, 0, 1, 1);
/* window configuration */
dg_core_window_push_grid(_w, _g);
dg_core_window_rename(_w, MSG, NULL);
dg_core_window_activate(_w);
/* event loop */
dg_core_loop_run();
return 0;
}
[\code]
Note, this is my old API that I'm deprecating soon because some of my decisions were retarded (like splitting the GUI engine and widget implementations into two modules, "core" and "base" respectively).