Nana is a cross-platform library for GUI programming in modern C++ style. Learn more...

  • LANGUAGE C++11/14/17
  • COMPILER Any Standard C++ compiler(Visual C++ 2013, GCC/MinGW and Clang)
  • PLATFORM Windows/Linux(X11)/FreeBSD(X11)
#include <nana/gui.hpp>
#include <nana/gui/widgets/label.hpp>
#include <nana/gui/widgets/button.hpp>

int main()
{
    using namespace nana;

    //Define a form.
    form fm;

    //Define a label and display a text.
    label lab{fm, "Hello, <bold blue size=16>Nana C++ Library</>"};
    lab.format(true);

    //Define a button and answer the click event.
    button btn{fm, "Quit"};
    btn.events().click([&fm]{
        fm.close();
    });

    //Layout management
    fm.div("vert <><<><weight=80% text><>><><weight=24<><button><>><>");
    fm["text"]<<lab;
    fm["button"] << btn;
    fm.collocate();
	
    //Show the form
    fm.show();

    //Start to event loop process, it blocks until the form is closed.
    exec();
}
Screenshots See applications using Nana

Nana C++ Library 1.7 Available Now

Nana 1.7 brings several updates - including enhanced stability, usability and numerous other bug fixes and improvements. Many features ...


Happy Chinese New Year

First of all, Thanks to Gabriel Ferri and Mehrzad Abdollahi for their thoughtful donations at the beginning of 2019! Their donations ...


Filebox Appearance

I improved the appearance of filebox. These changes make the filebox more user-friendly under Linux. The screenshot blow shows the ...


>>> More