Project

General

Profile

Bug #2078 » progressive_set_initial_path_20130728a.cc

Bruce Toll, 07/31/2013 02:17 PM

 
#include <Wt/WServer>
#include <Wt/WPushButton>

class TestApp : public Wt::WApplication
{
bool update_cnt_ {0};

public:
TestApp(const Wt::WEnvironment& env) : Wt::WApplication(env)
{
setInternalPath("/internal01");
auto button = new Wt::WPushButton(root());
button->setText("Press to update internal path.");
button->clicked().connect(std::bind([=](){
if (!update_cnt_++)
setInternalPath("/internal02");
}));
}
};

int main(int argc, char **argv)
{
return Wt::WRun(argc, argv, [](const Wt::WEnvironment& env) {return new TestApp(env);});
}
(1-1/2)