Intro

Hello world example1

This example shows how easy it is to create a simple message dialog window.

hello1.c:

01
02
03
04
05
06
07
08
09
10
11
12
13


#include <GDXlib/GDXlib.h>

int main(int argc, char *argv[]){

  x_open();

  x_msgbox(5,"hello world","hello world","fixed",50);

  x_close();

  return 0;
}


Hello world example2

This next example introduces widgets. This program will create a window 200 pixels by 200 pixels with a label and a button widget.

hello2.c:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


#include <GDXlib/GDXlib.h>

void button_pressed(){

  gdx_closewindow();

}

int main(int argc, char *argv[]){

  int button;

  x_open();

  gdx_window("hello world", 200, 200);

  gdx_label("hello world", 20, 25, 0);

  button = gdx_button(20, 50, "Ok", button_pressed);

  gdx_main();

  x_close();
   
  return 0;
}