Having a class that is derived from nana::form, that is used as a modal window, it does not show the modal window and instantly closes it.
#include <nana\gui.hpp>
#include <iostream>
using namespace std;
using namespace nana;
class fm1 : public form
{
public:
fm1() : form()
{
this->caption("form 1");
}
};
class fm2 : public form
{
public:
fm2(form parent) : form(parent)
{
this->caption("form 2");
}
};
int main()
{
fm1 fm;
fm.events().click([&fm]
{
fm2 fm_modal(fm); // does not work
//form fm_modal(fm); // does work
fm_modal.modality();
std::cout << "modal form was closed" << std::endl;
});
fm.show();
exec();
}
Having a class that is derived from
nana::form
, that is used as a modal window, it does not show the modal window and instantly closes it.