Advertisement
oOBATOo

Untitled

Sep 6th, 2022
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <gtk/gtk.h>
  4.  
  5. #include <sys/types.h>
  6. #include <sys/stat.h>
  7. #include <unistd.h>
  8.  
  9.  
  10. char Output;
  11.  
  12. static void open_dialog(GtkWidget* buton,gpointer window)
  13. {
  14.  
  15.  
  16. GtkWidget *dialog;
  17. dialog=gtk_file_chooser_dialog_new("Choose a file to execute",GTK_WINDOW(window),
  18. GTK_File_CHOOSER_Action_OPEN_GTK_STOCK_OK,
  19. GTK_RESPONSE_OK,GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
  20.  
  21. gtk_widget_show_all(dialog);
  22. gint resp=gtk_dialog_run(GTK_DIALOG(dialog))
  23. if(resp==GTK_RESPONSE_OK)
  24. Output = gtk_file_chooser_get_filename(GTK_FILE_CHOSER(dialog));
  25. return(Output);
  26. else
  27. gtk_widget_destroy(dialog);
  28. }
  29.  
  30.  
  31.  
  32.  
  33. static void Prosess(Output)
  34. {
  35. }
  36.  
  37. // gcc 007_gtk.c -o 007_gtk `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
  38. int main(int argc, char **argv)
  39. {
  40. if (argc > 1) {
  41. struct stat sb;
  42. printf("%s is%s executable.\n", argv[1], stat(argv[1], &sb) == 0 &&
  43. sb.st_mode & S_IXUSR ?
  44. "" : " not");
  45. }
  46. return 0;
  47. }
  48.  
  49. }
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement