Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
github.com/Alloyed/nativefiledialog
A tiny, neat C library that portably invokes native file open, folder select and save dialogs. Write dialog code once and have it pop up native dialogs on all supported platforms. Avoid linking large dependencies like wxWidgets and qt.
Features:
IFileDialog
on Windows.#include <nfd.h>
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
nfdchar_t *outPath = NULL;
nfdresult_t result = NFD_OpenDialog( NULL, NULL, &outPath );
if ( result == NFD_OKAY ) {
puts("Success!");
puts(outPath);
free(outPath);
}
else if ( result == NFD_CANCEL ) {
puts("User pressed cancel.");
}
else {
printf("Error: %s\n", NFD_GetError() );
}
return 0;
}
See NFD.h for more options.
The current version is 1.1.1
release | what's new | date |
---|---|---|
1.0.0 | initial | oct 2014 |
1.1.0 | premake5; scons deprecated | aug 2016 |
1.1.1 | mingw support, build fixes | aug 2016 |
1.1.2 | test_pickfolder() added | aug 2016 |
NFD uses Premake5 generated Makefiles and IDE project files. The generated project files are checked in under build/
so you don't have to download and use Premake in most cases.
If you need to run Premake5 directly, further build documentation is available.
Previously, NFD used SCons to build. It still works, but is now deprecated; updates to it are discouraged. Opt to use the native build system where possible.
nfd.a
will be built for release builds, and nfd_d.a
will be built for debug builds.
The makefile offers four options, with release_x64
as the default.
make config=release_x86
make config=release_x64
make config=debug_x86
make config=debug_x64
src/include
to your include search path.nfd.lib
or nfd_d.lib
to the list of list of static libraries to link against (for release or debug, respectively).build/<debug|release>/<arch>
to the library search path.On Linux, you must compile and link against GTK+. Recommend use of pkg-config --cflags --libs gtk+-3.0
.
On Mac OS X, add AppKit
to the list of frameworks.
On Windows, ensure you are building against comctl32.lib
.
See NFD.h
for API calls. See tests/*.c
for example code.
After compiling, build/bin
contains compiled test programs.
There is a form of file filtering in every file dialog API, but no consistent means of supporting it. NFD provides support for filtering files by groups of extensions, providing its own descriptions (where applicable) for the extensions.
A wildcard filter is always added to every dialog.
;
Begin a new filter.,
Add a separate type to the filter.txt
The default filter is for text files. There is a wildcard option in a dropdown.
png,jpg;psd
The default filter is for png and jpg files. A second filter is available for psd files. There is a wildcard option in a dropdown.
NULL
Wildcard only.
See test_opendialogmultiple.c.
I accept quality code patches, or will resolve these and other matters through support. See submitting pull requests for details.
GetOpenFileName
.nfd_zenity.c
implementation which uses Zenity and pipes.Copyright © 2014-2016 Frogtoss Games, Inc. File LICENSE covers all files in this repo.
Native File Dialog by Michael Labbe mike@frogtoss.com
Tomasz Konojacki for microutf8
Denis Kolodin for mingw support.
Directed support for this work is available from the original author under a paid agreement.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.