⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.38 KB)
Bug #7230
ยป main.cpp
Marco Kinski
, 09/09/2019 09:43 PM
#include
<Wt/WServer.h>
#include
<Wt/WApplication.h>
#include
<Wt/WEnvironment.h>
#include
<Wt/WContainerWidget.h>
#include
<Wt/WVBoxLayout.h>
#include
<Wt/WCssDecorationStyle.h>
class
MyApp
:
public
Wt
::
WApplication
{
Wt
::
WVBoxLayout
*
innerLayout
{
nullptr
};
public:
MyApp
(
const
Wt
::
WEnvironment
&
e
)
:
Wt
::
WApplication
(
e
)
{
root
()
->
decorationStyle
().
setBackgroundColor
(
Wt
::
StandardColor
::
Yellow
);
auto
layout
=
root
()
->
setLayout
(
std
::
make_unique
<
Wt
::
WVBoxLayout
>
());
auto
north
=
layout
->
addWidget
(
std
::
make_unique
<
Wt
::
WContainerWidget
>
(),
1
);
north
->
decorationStyle
().
setBackgroundColor
(
Wt
::
StandardColor
::
Green
);
auto
south
=
layout
->
addWidget
(
std
::
make_unique
<
Wt
::
WContainerWidget
>
(),
1
);
south
->
decorationStyle
().
setBackgroundColor
(
Wt
::
StandardColor
::
Blue
);
layout
->
setResizable
(
0
);
}
static
std
::
unique_ptr
<
MyApp
>
Instance
(
const
Wt
::
WEnvironment
&
env
)
{
return
std
::
make_unique
<
MyApp
>
(
env
);
}
};
int
main
(
int
argc
,
char
**
argv
)
try
{
Wt
::
WServer
wserver
{
argc
,
argv
};
// Wt::WLayout::setDefaultImplementation(Wt::LayoutImplementation::JavaScript);
wserver
.
addEntryPoint
(
Wt
::
EntryPointType
::
Application
,
&
MyApp
::
Instance
);
wserver
.
run
();
return
0
;
}
catch
(
std
::
exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
std
::
endl
;
return
10
;
}
(1-1/1)
Loading...