Nana C++ Library. Reference for users.: Home. Reference documentation. {for nana users, hotfix-1.7.2, 2019-12-04} (original) (raw)
Automatically generated from the source code of Nana.
#include <nana/gui.hpp>
#include <nana/gui/widgets/button.hpp>
#include <nana/gui/widgets/group.hpp>
#include <nana/gui/widgets/label.hpp>
#include <nana/gui/msgbox.hpp>
int main()
{
using namespace nana;
form fm ;
fm.caption("My first NANA demo");
place fm_place{fm};
bool really_quick{false};
label hello{fm,"Hello World"};
button btn {fm,"Quit"};
btn.tooltip( "I will ask first");
group act {fm, "Actions"};
act.add_option("Quick quickly")
btn.tooltip("Quick quickly"); });
act.add_option("Ask first")
.events().click([&]() { really_quick=false;
btn.tooltip("I will ask first"); });
btn.events().click([&]()
{
if (!really_quick)
{
m.icon(m.icon_question);
m << "Are you sure you want to quick?";
auto response= m();
if (response != m.pick_yes) return;
}
});
act.radio_mode(true);
fm_place.div("vertical |70% ");
fm_place["label" ]<< hello << btn;
fm_place["actions"]<< act ;
fm_place.collocate();
fm.show();
}