mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-06 12:55:05 +00:00
d5d381328b
it will replace portable-file-dialogs on Windows, and perhaps in the rest of operating systems (maybe not Linux) as well.
28 lines
533 B
C
28 lines
533 B
C
#include "nfd.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* this test should compile on all supported platforms */
|
|
|
|
int main( void )
|
|
{
|
|
nfdchar_t *savePath = NULL;
|
|
nfdresult_t result = NFD_SaveDialog( "png,jpg;pdf", NULL, &savePath );
|
|
if ( result == NFD_OKAY )
|
|
{
|
|
puts("Success!");
|
|
puts(savePath);
|
|
free(savePath);
|
|
}
|
|
else if ( result == NFD_CANCEL )
|
|
{
|
|
puts("User pressed cancel.");
|
|
}
|
|
else
|
|
{
|
|
printf("Error: %s\n", NFD_GetError() );
|
|
}
|
|
|
|
return 0;
|
|
}
|