⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.11 KB)
Support #2418
» bug2418.cpp
Koen Deforche
, 11/22/2013 01:24 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
*
button1
=
new
WPushButton
(
"Button 1"
,
root
()
);
button1
->
clicked
().
connect
(
this
,
&
MyApp
::
changePath1
);
WPushButton
*
button2
=
new
WPushButton
(
"Button 2"
,
root
()
);
button2
->
clicked
().
connect
(
this
,
&
MyApp
::
changePath2
);
internalPathChanged
().
connect
(
this
,
&
MyApp
::
handlePathChange
);
}
void
changePath1
()
{
std
::
cerr
<<
"Button1 clicked"
<<
std
::
endl
;
setInternalPath
(
"/page1"
,
false
);
}
void
changePath2
()
{
std
::
cerr
<<
"Button2 clicked"
<<
std
::
endl
;
setInternalPath
(
"/page2"
,
true
);
}
void
handlePathChange
(
std
::
string
path
)
{
std
::
cout
<<
"handlePathChange "
<<
path
<<
std
::
endl
;
}
};
WApplication
*
createMyApplication
(
const
WEnvironment
&
env
)
{
return
new
MyApp
(
env
);
}
int
main
(
int
argc
,
char
**
argv
)
{
return
WRun
(
argc
,
argv
,
&
createMyApplication
);
}
« Previous
1
2
Next »
(1-1/2)
Loading...