Bug #1907 » stretch.cpp
1 |
#include <Wt/WApplication>
|
---|---|
2 |
#include <Wt/WLabel>
|
3 |
#include <Wt/WPushButton>
|
4 |
#include <Wt/WContainerWidget>
|
5 |
#include <Wt/WHBoxLayout>
|
6 |
#include <Wt/WText>
|
7 |
#include <Wt/WSpinBox>
|
8 |
#include <iostream>
|
9 |
|
10 |
using namespace Wt; |
11 |
|
12 |
class Test : public WApplication |
13 |
{
|
14 |
public:
|
15 |
Test(const WEnvironment& env) |
16 |
: WApplication(env) |
17 |
{
|
18 |
WHBoxLayout *layout = new WHBoxLayout(root()); |
19 |
root()->setMaximumSize(WLength::Auto, 1000); |
20 |
|
21 |
layout->addWidget(new WText("Text 1")); |
22 |
layout->addWidget(new WText("Text 2")); |
23 |
layout->addWidget(new WSpinBox()); |
24 |
layout->addWidget(new WText("Text 3")); |
25 |
layout->addStretch(1); |
26 |
layout->addWidget(new WText("Text 4")); |
27 |
}
|
28 |
|
29 |
void foo() { |
30 |
}
|
31 |
};
|
32 |
|
33 |
WApplication *createApplication(const WEnvironment& env){ |
34 |
return new Test(env); |
35 |
}
|
36 |
|
37 |
int main(int argc, char *argv[]){ |
38 |
return WRun(argc, argv, createApplication); |
39 |
}
|
40 |
|