/nvdialog

A simple and cross-platform dialog message solution, supporting C, C++ and Rust.

Primary LanguageCMIT LicenseMIT

libnvdialog


A cross-platform dialog library.

libnvdialog is a simple dialog box library written in C (Bindings for Rust also exist) for multiple purposes such as games, app development, simple UI boxes for terminal apps or anything else. If you need something that doesn't require a bunch of setup this library is for you.
If you like this project, support it by recommending it and starring it. Thanks :)
libnvdialog Website

Backends

  • Adwaita Backend
    A backend using libadwaita and Gtk4. Currently unsupported because it requires Gtk4 (see the Gtk3 backend below for more).\

  • Gtk3 Backend
    Some older distributions do not have Adwaita / Gtk4 support yet. The Gtk3 backend can be used in such a situation. However Gtk3 is considered to be deprecated and will be replaced with libadwaita later in the library.

  • Win32 Backend
    Windows-specific backend, used only for Windows compatibility.

  • Fallback Backend
    This backend is only used if everything else fails. It outputs an error message to the console.

Example

This is a simple cross-platform example of a simple message box greeting the user:

#include <nvdialog.h>
#include <stdio.h>

int main(int argc, char **argv)
{
        /* Initializing the library. */
        nvd_init(argv[0]);

        /* Creating the dialog. */
        nvd_dialog_box_new(
                "Hello, world!",
                "Hello world ! This is a dialog box created using libnvdialog!",
                NVD_DIALOG_SIMPLE
        );
}

Yes, it's that simple ! The library is designed with simplicity in mind so it will not require anything else to work.

Screenshots

Warning dialog using libnvdialog
Info dialog using libnvdialog
Error dialog using libnvdialog

Installation

Make sure you have installed CMake before doing anything else ! The library can only be installed using CMake. See CMake's website for more information.

  • First, clone the repository:
$ git clone --depth=1 https://github.com/AndroGR/libnvdialog.git && cd libnvdialog/
  • Compile the library:
$ mkdir build/ && cd build/
$ cmake ..
$ make -j`nproc`
  • And install it on your system:
$ sudo make install -j`nproc`

License

nvdialog is licensed under the MIT license. See COPYING for more.