Re: help with sigc::mem_fun
- From: Baltasar <baltasarq yahoo es>
- To: Radu Brehar <radubrehar yahoo co uk>, gtkmm-list gnome org
- Subject: Re: help with sigc::mem_fun
- Date: Fri, 07 Jul 2006 11:27:21 +0200
Hi !
> Thank you very much for your support... You have
> enlightened me in this matter:)
You're welcome :-)
> I mean, when the button is clicked, I want the
> corresponding method to be called, with an "int"
> parameter"
As many have already pointed out, the documentation about his issue is
here:
http://libsigc.sourceforge.net/libsigc2/docs/manual/html/ch04.html#id2450855
In order to pass an integer, you should use:
button->signal_edited().connect(
sigc::bind<int>(
sigc::mem_fun( *this,
&ButtonAdd::on_button_clicked ),
0 ) // this is the integer you're going to pass
);
Maybe you'd rather send the Child * pointer:
button->signal_edited().connect(
sigc::bind<Child *>(
sigc::mem_fun( *this,
&ButtonAdd::on_button_clicked ),
c ) // this is the child *
// you receive in your constructor
);
Of course, on_button_clicked should now receive a Child * as parameter.
Salud !
Baltasar
--
Baltasar
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]