[Y-devel] Sample program/signals help
James Harr james at grickle.org
Thu Feb 26 00:45:14 GMT 2004
Y: 0.2--patch-22
gcc: 3.3.3
autoconf: 2.59
automake: 1.8.2
I've been trying to add a couple signal calls to provide more of an example in
the sample program.
I've inserted this code in main() after their respective grid->addWidget
lines:
samplebutton -> clicked.connect (bind
(slot (this, &Sample::buttonClicked)) );
samplecheckbox -> clicked.connect (bind
(slot (this, &Sample::checkboxChanged)) );
As well as these two functions:
/********SNIP********/
void Sample::buttonClicked ()
{
cout << "Button pressed" << endl;
}
void Sample::checkboxChanged ()
{
cout << "Checkbox changed" << endl;
}
/********SNIP********/
And a corresponding public declarations in the sample.h.
However when I compile, I get an error. It looks like there's something wrong
with the templates (well, my use of the templates). I saw very similar code
used in calculator.
james at cerberus:~/Y/Y--devel--0.2--patch-22/build/clients/sample$ make
if g++ -DHAVE_CONFIG_H -I. -I../../../clients/sample -I../../Y -I../../..
-I../.. -I/usr/local/lib/sigc++-1.0/include -I/usr/local/include/sigc++-1.0
-I../../../libY -I../../../libYc++ -D_REENTRANT -pthread -g -O0 -Wall
-Wwrite-strings -Wpointer-arith -Wcast-qual -Wimplicit -Wstrict-prototypes
-Wmissing-prototypes -W -Wno-unused -Wno-shadow -Wundef -Wpacked
-Wfloat-equal -Werror -O3 -MT sample.o -MD -MP -MF ".deps/sample.Tpo" -c -o
sample.o ../../../clients/sample/sample.cc; \
then mv -f ".deps/sample.Tpo" ".deps/sample.Po"; else rm -f
".deps/sample.Tpo"; exit 1; fi
../../../clients/sample/sample.cc: In constructor `Sample::Sample()':
../../../clients/sample/sample.cc:40: error: no matching function for call to
`
SigC::Signal1<void, bool, SigC::Marshal<void>
>::connect(SigC::Slot0<void>)'
/usr/local/include/sigc++-1.0/sigc++/basic_signal.h:305: error: candidates
are:
SigC::Connection SigC::Signal1<void, P1, Marsh>::connect(const
SigC::Slot1<void, P1>&) [with P1 = bool, Marsh = SigC::Marshal<void>]
make: *** [sample.o] Error 1
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved