Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabioarnold/nfd-zig
OS-native file dialogs on Linux, macOS and Windows
https://github.com/fabioarnold/nfd-zig
file-dialog native zig zig-package
Last synced: about 1 month ago
JSON representation
OS-native file dialogs on Linux, macOS and Windows
- Host: GitHub
- URL: https://github.com/fabioarnold/nfd-zig
- Owner: fabioarnold
- License: mit
- Created: 2020-12-27T19:12:22.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T15:44:57.000Z (6 months ago)
- Last Synced: 2024-12-25T06:13:09.845Z (about 1 month ago)
- Topics: file-dialog, native, zig, zig-package
- Language: Makefile
- Homepage:
- Size: 180 KB
- Stars: 51
- Watchers: 3
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zig - nfd-zig🗒️OS-native file dialogs on Linux, macOS and Windows
README
# nfd-zig
`nfd-zig` is a Zig binding to the library [nativefiledialog](https://github.com/mlabbe/nativefiledialog) which provides a convenient cross-platform interface to opening file dialogs on Linux, macOS and Windows.
This library has been tested on Windows 10, macOS 11.1 and Linux.
## Usage
You can run a demo with `zig build run`. The demo's source is in `src/demo.zig`.
If you want to add the library to your own project...
- Add the `nfd` dependency to your `build.zig.zon`
```zig
.{
.dependencies = .{
.nfd = .{ .path = "libs/nfd-zig" }, // Assuming nfd-zig is available in the local directory. Use .url otherwise.
}
}
```
- Add the import in your `build.zig`:
```zig
const nfd = b.dependency("nfd", .{});
const nfd_mod = nfd.module("nfd");
exe.root_module.addImport("nfd", nfd_mod);
```## Screenshot
![Open dialog on Windows 10](https://raw.githubusercontent.com/mlabbe/nativefiledialog/67345b80ebb429ecc2aeda94c478b3bcc5f7888e/screens/open_win.png)