⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (927 Bytes)
Bug #868
ยป path.cpp
Boris Nagaev
, 06/27/2011 11:29 PM
#include
<Wt/WApplication>
#include
<Wt/WContainerWidget>
#include
<Wt/WText>
#include
<Wt/WAnchor>
class
HelloApp
:
public
Wt
::
WApplication
{
public:
HelloApp
(
const
Wt
::
WEnvironment
&
env
)
:
Wt
::
WApplication
(
env
)
{
internalPathChanged
().
connect
(
this
,
&
HelloApp
::
path_handler_
);
a_
(
"/foo/"
);
a_
(
"/bar/"
);
a_
(
"/foo/bar/"
);
a_
(
"/foo/bar/1/"
);
}
private
:
void
path_handler_
()
{
new
Wt
::
WBreak
(
root
());
new
Wt
::
WText
(
resolveRelativeUrl
(
"img/1.img"
),
root
());
}
void
a_
(
const
std
::
string
&
t
)
{
new
Wt
::
WBreak
(
root
());
Wt
::
WAnchor
*
a
=
new
Wt
::
WAnchor
(
root
());
a
->
setText
(
t
);
a
->
setRefInternalPath
(
t
);
}
};
Wt
::
WApplication
*
createApplication
(
const
Wt
::
WEnvironment
&
env
)
{
return
new
HelloApp
(
env
);
}
int
main
(
int
argc
,
char
**
argv
)
{
return
Wt
::
WRun
(
argc
,
argv
,
&
createApplication
);
}
(1-1/1)
Loading...