Subversion Repositories Kolibri OS

Rev

Rev 9553 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include <sys/ksys.h>
  2. #include <clayer/dialog.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.     kolibri_dialog_init(); // dialog init
  8.     open_dialog *dlg_open = kolibri_new_open_dialog(OPEN, 10, 10, 420, 320); // create opendialog struct
  9.     OpenDialog_init(dlg_open); // Initializing an open dialog box.
  10.     OpenDialog_start(dlg_open); // Show open dialog box
  11.    
  12.     color_dialog *color_select = kolibri_new_color_dialog(SELECT, 10, 10,420,320); // create colordialog struct
  13.     ColorDialog_init(color_select); // Initializing an color dialog box.
  14.     ColorDialog_start(color_select); // Show color dialog
  15.    
  16.     if(dlg_open->status == SUCCESS){
  17.         printf("File selected '%s'\n",dlg_open->openfile_path);
  18.     }else{
  19.         puts("No file selected!");
  20.     }
  21.    
  22.     if(color_select->status == SUCCESS){
  23.         printf("Color selected: #%06X\n",color_select->color);
  24.         rgb_t color_rgb = (rgb_t)color_select->color;
  25.         printf("Red:%d Green:%d Blue:%d", color_rgb.red, color_rgb.green, color_rgb.blue);
  26.     }else{
  27.         puts("No color selected!");
  28.     }
  29.     free(dlg_open);
  30.     free(color_select);
  31.     return 0;
  32. }
  33.