⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (883 Bytes)
Bug #798
» main.cpp
main.cpp -
Marco Poletti
, 04/20/2011 04:43 PM
#include
<Wt/WApplication>
#include
<Wt/WPushButton>
#include
<Wt/WContainerWidget>
#include
<Wt/WDialog>
using
namespace
Wt
;
class
MyApplication
:
public
WApplication
{
public:
MyApplication
(
const
WEnvironment
&
environment
)
:
WApplication
(
environment
)
{
WPushButton
*
button
=
new
WPushButton
(
"Open dialog"
);
button
->
clicked
().
connect
(
this
,
&
MyApplication
::
openDialog
);
root
()
->
addWidget
(
button
);
}
void
openDialog
()
{
WDialog
dialog
(
"AAA"
);
dialog
.
rejectWhenEscapePressed
();
WPushButton
*
abortButton
=
new
WPushButton
(
"Abort"
);
abortButton
->
clicked
().
connect
(
&
dialog
,
&
WDialog
::
reject
);
dialog
.
contents
()
->
addWidget
(
abortButton
);
dialog
.
exec
();
}
};
WApplication
*
createApplication
(
const
WEnvironment
&
environment
)
{
return
new
MyApplication
(
environment
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
return
WRun
(
argc
,
argv
,
&
createApplication
);
}
« Previous
1
2
3
Next »
(1-1/3)
Loading...