⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (554 Bytes)
Bug #3994
ยป Example.cpp
Markus S
, 04/20/2015 02:54 PM
namespace
{
class
TestContextMenu
:
public
Wt
::
WApplication
{
public:
TestContextMenu
(
const
Wt
::
WEnvironment
&
env
)
:
Wt
::
WApplication
(
env
)
{
auto
button
=
new
Wt
::
WPushButton
(
"OpenPopupMenu"
);
button
->
clicked
()
.
connect
(
[](
Wt
::
WMouseEvent
e
)
{
auto
popup
=
new
Wt
::
WPopupMenu
();
popup
->
addItem
(
"MenuItem 1"
)
->
triggered
()
.
connect
(
[](...){
Wt
::
WMessageBox
::
show
(
"Ok"
,
"MenuItem 1 Triggered"
,
Wt
::
Ok
);
}
);
popup
->
exec
(
e
);
});
root
()
->
addWidget
(
button
);
}
};
}
(1-1/1)
Loading...