Subversion Repositories Kolibri OS

Rev

Rev 9620 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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