Project

General

Profile

Bug #1336 ยป layout-fileupload.cpp

Boris Nagaev, 06/21/2012 07:53 PM

 

#include <Wt/WFileUpload>
#include <Wt/WHBoxLayout>
#include <Wt/WContainerWidget>
#include <Wt/WApplication>

using namespace Wt;

class App : public WApplication {
public:
WHBoxLayout* l;

App(const WEnvironment& env):
WApplication(env) {
l = new WHBoxLayout();
root()->setLayout(l);
foo();
}

void foo() {
WFileUpload* u = new WFileUpload();
l->clear();
l->addWidget(u, 0, Wt::AlignLeft);
u->changed().connect(u, &WFileUpload::upload);
u->uploaded().connect(this, &App::foo);
}
};

WApplication* createApp(const WEnvironment& env) {
return new App(env);
}

int main(int argc, char** argv) {
return WRun(argc, argv, &createApp);
}

    (1-1/1)