Re: need help with sigc::mem_fun1



> Hello,
>
> I'm new to gtk, so hope you don't mind me having a few
> basic questions.

I recommend gtkmm-list if you have more questions about the gtkmm C++ API.

> I'll try to be straightforward. I have a button, that
> for example wants to do something with an object which
> is an instance of a class called "Child". In the
> constructor of the button (called ButtonAdd) I do
>
> m_button.signal_clicked ().connect
> (sigc::mem_fun1(*this,
> &ButtonAdd::on_button_clicked,Child *));

You should never need to use sigc::mem_fun1. Just sigc::mem_fun should be
fine.

> and I have a method
>
> void ButtonAdd::on_button_clicked(Child *)
>
>
> but it won't work. I know that using
> mem_fun(*this,&ButtonAdd::on_button_clicked)) works,
> but I want to send this parameter to the method.

For this you could use sigc::bind, or class member variable.

[snip]

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]