Native dialogs
Native dialogs are dialogs which can be created and used through APIs which are provided by the operating system. Some dialogs are modal and block all interaction with the parent window, and some are modeless and behave mostly like regular windows.
Some examples of native dialogs are:
- File dialogs
- The "about" dialog
- Modal "confirmation" dialogs
There are a couple of crates which allow you to create different kinds of dialogs.
Pure Rust
Most of these crates can't implement all of their functionality in Rust since they have to call either OS-provided code on Windows and macOS, or use GTK/Qt or shell out to KDialog or Zenity on Linux. Despite this, we consider them "pure Rust" if they don't include a C "native dialog" library as a part of their build process.
Crate name | Status (latest version) | Development status (last updated) | File dialog | Message box | Windows | macOS | Linux | Notes |
---|---|---|---|---|---|---|---|---|
0.3.0
|
KDialog, Zenity | Can also use the similarly named dialog tool to display a dialog via ncurses. Can also use the terminal directly in the absence of any external tools. You can either choose which tool to use (or not use any tool) or let the library choose for you.
| ||||||
0.1.0
|
Zenity | Also supports a date picker and a message box with a text input. | ||||||
0.7.0
|
GTK | Intentionally only exposes message boxes with a single "Ok" button. | ||||||
0.6.4
|
KDialog, Zenity | Uses 0.1.7 for file dialogs and 0.3.9 for message boxes on Windows. Uses 0.3.0 on macOS.
| ||||||
0.1.7
|
Calls Windows APIs through 0.3.9 .
|
Rust Wrappers
Crate name | Status (latest version) | Development status (last updated) | File dialog | Message box | Windows | macOS | Linux | Wraps | Notes |
---|---|---|---|---|---|---|---|---|---|
0.0.4
|
GTK | nativefiledialog (C)
|
nativefiledialog can optionally shell out to Zenity so that you can avoid depending on GTK, but nfd does not expose this option.
| ||||||
0.3.1
|
GTK | nativefiledialog (C)
|
Fork of 0.0.4 by Embark Studios, created due to concerns about a lack of bug-fixing from nfd 's maintainer. The repository's README claims that they wish to eventually replace all C code with Rust.
| ||||||
0.1.1
|
nativefiledialog (C)
|
Despite being based on nativefiledialog , the README only claims support for macOS.
| |||||||
3.9.1
|
KDialog, Zenity | tinyfiledialogs (C) | Most downloaded crate by a wide margin as of July 2020 according to crates.io. | ||||||
0.1.1
|
GTK | Boxer (C++) | Uses a forked version of Boxer, which is a C++ library. The forked version has changed the implementation language to C. |