Skip to content

lwhite14/nfd-zig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nfd-zig

nfd-zig is a Zig binding to the library 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/11, 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 package to your build.zig.zon file
    .dependencies = .{
        .nfd = .{
            .url = "https://github.com/fabioarnold/nfd-zig/archive/d85279e0acac16daf12ad26fce45aba7d13276b1.tar.gz",
            .hash = "12201c12379ee12e5b921f015a041dcd65428717d0d4b97bfbf40153897f3f8d4dc1",
            // If you want to use the most current version of the master branch, use the url below.
            // Delete the '.hash = "...",'. Run 'zig build'. It will fail, providing you with the uptodate hash.
            // .url = "https://github.com/fabioarnold/nfd-zig/archive/master.tar.gz",
        },
    },
  • Add the nfd package to your executable in your build.zig
    const nfd_dep = b.dependency("nfd", .{ .target = target, .optimize = optimize });
    exe.root_module.addImport("nfd", nfd_dep.module("nfd"));
  • Import the library
    const nfd = @import("nfd");

Screenshot

Open dialog on Windows 10

About

OS-native file dialogs on Linux, macOS and Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Makefile 58.2%
  • C 18.8%
  • C++ 11.8%
  • Objective-C 4.5%
  • Lua 4.1%
  • Zig 2.6%