Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.         hello world example
  3. */
  4.  
  5. #include "libGUI.h"
  6.  
  7. #define TRUE            1
  8. #define FALSE           0
  9.  
  10. void    callback_func_delete_window(header_t *control,void *data)
  11. {
  12.         QuitLibGUI((parent_t*)control);
  13. }
  14.  
  15. int main(int argc, char *argv[])
  16. {
  17.         parent_t                *window;
  18.         gui_text_data_t txtdata;
  19.         gui_text_t              *text;
  20.  
  21.         //load libGUI library
  22.         LoadLibGUI(NULL);//load from default system path to library
  23.         //create main window
  24.         window=CreateWindow();
  25.         //change size of window
  26.         SetWindowSizeRequest(window,92,46);
  27.         //set callback function for button close window
  28.         SetCallbackFunction(window,DELETE_EVENT,&callback_func_delete_window,NULL);
  29.         //create control text
  30.         txtdata.x=5;
  31.         txtdata.y=5;
  32.         txtdata.font=NULL;//use default system libGUI font
  33.         txtdata.background=TRUE;//use background for text
  34.         txtdata.color=0xffffff;//text color
  35.         txtdata.background_color=0xff8000;//background color
  36.         txtdata.text="Hello world!";
  37.         text=CreateText(&txtdata);
  38.        
  39.         //pack control text in window
  40.         PackControls(window,text);
  41.  
  42.         //start libGUI main loop
  43.         LibGUImain(window);
  44. }
  45.  
  46.