Project

General

Profile

Bug #827 ยป hello.C

Pieter Libin, 05/18/2011 01:24 PM

 
/*
* Copyright (C) 2010 Emweb bvba, Heverlee, Belgium.
*
* See the LICENSE file for terms of use.
*/

#include <Wt/WApplication>
#include <Wt/WBreak>
#include <Wt/WContainerWidget>
#include <Wt/WLineEdit>
#include <Wt/WPushButton>
#include <Wt/WText>
#include <Wt/WSelectionBox>

using namespace Wt;

class HelloApplication : public WApplication
{
public:
HelloApplication(const WEnvironment& env);

private:
void push();
WSelectionBox *selectionBox_;
};

HelloApplication::HelloApplication(const WEnvironment& env)
: WApplication(env)
{
selectionBox_ = new WSelectionBox(root());
selectionBox_->setFocus(true);

WPushButton* b = new WPushButton("push", root());
b->clicked().connect(boost::bind(&HelloApplication::push, this));
}

void HelloApplication::push()
{
selectionBox_->setFocus(true);
}

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

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

    (1-1/1)