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