⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (913 Bytes)
Bug #763
ยป test.C
Kurt Roeckx
, 03/16/2011 09:23 PM
#include
<Wt/WApplication>
#include
<Wt/WStackedWidget>
#include
<Wt/WMenu>
#include
<Wt/WText>
using
namespace
Wt
;
class
Test
:
public
WApplication
{
public:
Test
(
const
WEnvironment
&
env
);
private:
WMenu
*
MainMenu
;
};
Test
::
Test
(
const
WEnvironment
&
env
)
:
WApplication
(
env
)
{
WStackedWidget
*
contents
=
new
WStackedWidget
();
contents
->
setId
(
"main_page"
);
MainMenu
=
new
WMenu
(
contents
,
Horizontal
);
MainMenu
->
setRenderAsList
(
true
);
MainMenu
->
setInternalPathEnabled
();
MainMenu
->
setInternalBasePath
(
"/"
);
MainMenu
->
addItem
(
WString
(
"Home"
),
new
WText
(
"Home"
))
->
setPathComponent
(
""
);
MainMenu
->
addItem
(
WString
(
"Test"
),
new
WText
(
"Test"
))
->
setPathComponent
(
"test2"
);
root
()
->
addWidget
(
MainMenu
);
root
()
->
addWidget
(
contents
);
}
WApplication
*
createApplication
(
const
WEnvironment
&
env
)
{
return
new
Test
(
env
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
WRun
(
argc
,
argv
,
&
createApplication
);
}
(1-1/1)
Loading...