⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (892 Bytes)
Bug #2527
ยป SetPath.cpp
Koen Deforche
, 02/07/2014 09:39 PM
#include
<Wt/WApplication>
#include
<Wt/WContainerWidget>
#include
<Wt/WPushButton>
#include
<Wt/WText>
using
namespace
Wt
;
class
MyApp
:
public
WApplication
{
public:
MyApp
(
const
WEnvironment
&
env
)
:
WApplication
(
env
)
{
WPushButton
*
button
=
new
WPushButton
(
"click to see alice"
,
root
()
);
button
->
clicked
().
connect
(
this
,
&
MyApp
::
changePath
);
internalPathChanged
().
connect
(
this
,
&
MyApp
::
handlePathChange
);
setInternalPath
(
"/login"
);
}
void
changePath
()
{
setInternalPath
(
"/alice/"
,
true
);
}
void
handlePathChange
(
std
::
string
path
)
{
std
::
cout
<<
"handlePathChange "
<<
path
<<
std
::
endl
;
new
WText
(
path
,
root
()
);
}
};
WApplication
*
createMyApplication
(
const
WEnvironment
&
env
)
{
return
new
MyApp
(
env
);
}
int
main
(
int
argc
,
char
**
argv
)
{
return
WRun
(
argc
,
argv
,
&
createMyApplication
);
}
(1-1/1)
Loading...