⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (1.01 KB)
Bug #7197
» spinbox_valueChanged.cpp
test to reproduce it (Wt 3) -
Roel Standaert, 08/14/2019 12:57 PM
#include
<Wt/WApplication>
#include
<Wt/WBreak>
#include
<Wt/WContainerWidget>
#include
<Wt/WDoubleSpinBox>
#include
<Wt/WPushButton>
#include
<Wt/WServer>
#include
<Wt/WSpinBox>
#include
<functional>
#include
<iostream>
int
main
(
int
argc
,
char
**
argv
)
{
return
Wt
::
WRun
(
argc
,
argv
,
[](
const
Wt
::
WEnvironment
&
env
)
{
auto
app
=
new
Wt
::
WApplication
(
env
);
auto
root
=
app
->
root
();
auto
intSpin
=
new
Wt
::
WSpinBox
(
root
);
auto
dblSpin
=
new
Wt
::
WDoubleSpinBox
(
root
);
new
Wt
::
WBreak
(
root
);
auto
connectBtn
=
new
Wt
::
WPushButton
(
Wt
::
utf8
(
"Connect signals"
),
root
);
connectBtn
->
clicked
().
connect
(
std
::
bind
([
intSpin
,
dblSpin
]{
intSpin
->
valueChanged
().
connect
(
std
::
bind
([](
int
value
){
std
::
cout
<<
"spinbox value changed to: "
<<
value
<<
'\n'
;
},
std
::
placeholders
::
_1
));
dblSpin
->
valueChanged
().
connect
(
std
::
bind
([](
double
value
){
std
::
cout
<<
"double spinbox value changed to: "
<<
value
<<
'\n'
;
},
std
::
placeholders
::
_1
));
}));
return
app
;
});
}
« Previous
1
2
Next »
(2-2/2)
Loading...