Project

General

Profile

Bug #3676 ยป keyWentUp.cc

Koen Deforche, 12/08/2014 09:40 AM

 
#include <Wt/WApplication>
#include <Wt/WLineEdit>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <iostream>

using namespace Wt;

class Test : public WApplication
{
public:
Test(const WEnvironment& env)
: WApplication(env)
{
WLineEdit *edit = new WLineEdit(root());
edit->keyWentUp().connect(this, &Test::foo);
}

void foo(const WKeyEvent& e) {
std::cerr << "Key up: " << e.key() << std::endl;
}
};

WApplication *createApplication(const WEnvironment& env){
return new Test(env);
}

int main(int argc, char *argv[]){
return WRun(argc, argv, createApplication);
}

    (1-1/1)