🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
741 B

  1. #include <nfd.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. /* this test should compile on all supported platforms */
  5. int main( void )
  6. {
  7. nfdchar_t *outPath = NULL;
  8. nfdpathset_t pathSet;
  9. nfdresult_t result = NFD_OpenDialogMultiple( "png,jpg;pdf", NULL, &pathSet );
  10. if ( result == NFD_OKAY )
  11. {
  12. size_t i;
  13. for ( i = 0; i < NFD_PathSet_GetCount(&pathSet); ++i )
  14. {
  15. nfdchar_t *path = NFD_PathSet_GetPath(&pathSet, i);
  16. printf("Path %li: %s\n", i, path );
  17. }
  18. NFD_PathSet_Free(&pathSet);
  19. }
  20. else if ( result == NFD_CANCEL )
  21. {
  22. puts("User pressed cancel.");
  23. }
  24. else
  25. {
  26. printf("Error: %s\n", NFD_GetError() );
  27. }
  28. return 0;
  29. }