Squashed 'external/nfd/' content from commit a1a40106

git-subtree-dir: external/nfd
git-subtree-split: a1a401062819beb8c3da84518ab1fe7de88632db
This commit is contained in:
SimoZ64
2025-05-04 00:37:23 +02:00
commit 6e9eb898f5
48 changed files with 8052 additions and 0 deletions

33
test/test_pickfolder.c Normal file
View File

@@ -0,0 +1,33 @@
#include <nfd.h>
#include <stdio.h>
#include <stdlib.h>
/* this test should compile on all supported platforms */
int main(void) {
// initialize NFD
// either call NFD_Init at the start of your program and NFD_Quit at the end of your program,
// or before/after every time you want to show a file dialog.
NFD_Init();
nfdchar_t* outPath;
// show the dialog
nfdresult_t result = NFD_PickFolder(&outPath, NULL);
if (result == NFD_OKAY) {
puts("Success!");
puts(outPath);
// remember to free the memory (since NFD_OKAY is returned)
NFD_FreePath(outPath);
} else if (result == NFD_CANCEL) {
puts("User pressed cancel.");
} else {
printf("Error: %s\n", NFD_GetError());
}
// Quit NFD
NFD_Quit();
return 0;
}