Project

General

Profile

Bug #1907 » stretch.cpp

Koen Deforche, 07/30/2013 09:06 PM

 
#include <Wt/WApplication>
#include <Wt/WLabel>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <Wt/WHBoxLayout>
#include <Wt/WText>
#include <Wt/WSpinBox>
#include <iostream>

using namespace Wt;

class Test : public WApplication
{
public:
Test(const WEnvironment& env)
: WApplication(env)
{
WHBoxLayout *layout = new WHBoxLayout(root());
root()->setMaximumSize(WLength::Auto, 1000);

layout->addWidget(new WText("Text 1"));
layout->addWidget(new WText("Text 2"));
layout->addWidget(new WSpinBox());
layout->addWidget(new WText("Text 3"));
layout->addStretch(1);
layout->addWidget(new WText("Text 4"));
}

void foo() {
}
};

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

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

(4-4/6)