mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 16:33:01 +00:00
d5d381328b
it will replace portable-file-dialogs on Windows, and perhaps in the rest of operating systems (maybe not Linux) as well.
32 lines
713 B
C
32 lines
713 B
C
#include "nfd.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* this test should compile on all supported platforms */
|
|
|
|
int main( void )
|
|
{
|
|
nfdpathset_t pathSet;
|
|
nfdresult_t result = NFD_OpenDialogMultiple( "png,jpg;pdf", NULL, &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 %i: %s\n", (int)i, path );
|
|
}
|
|
NFD_PathSet_Free(&pathSet);
|
|
}
|
|
else if ( result == NFD_CANCEL )
|
|
{
|
|
puts("User pressed cancel.");
|
|
}
|
|
else
|
|
{
|
|
printf("Error: %s\n", NFD_GetError() );
|
|
}
|
|
|
|
return 0;
|
|
}
|