Last active
August 29, 2015 14:10
-
-
Save mlabbe/6c2666b4e3a68824c485 to your computer and use it in GitHub Desktop.
API usage example of multiple UTF-8 Paths returned
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <nfd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* this test should compile on all supported platforms */ | |
int main( void ) | |
{ | |
nfdchar_t *outPath = NULL; | |
nfdpathset_t pathSet; | |
nfdresult_t result = NFD_OpenDialogMultiple( "png,jpg;pdf", "/Users/mlabbe/Desktop", &pathSet ); | |
if ( result == NFD_OKAY ) | |
{ | |
size_t i; | |
for ( i = 0; i < NFD_PathSet_GetCount(&pathSet); ++i ) | |
{ | |
nfdchar_t *path = NFD_PathSet_GetPath(&pathSet, i); | |
printf("Path %li: %s\n", i, path ); | |
} | |
NFD_PathSet_Free(&pathSet); | |
} | |
else if ( result == NFD_CANCEL ) | |
{ | |
puts("User pressed cancel."); | |
} | |
else | |
{ | |
printf("Error: %s\n", NFD_GetError() ); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment