Re: sigc::ptr_fun() compiler error



On Thu, 2005-06-30 at 18:20 -0700, Ron Lockwood-Childs wrote:
> Hello,
> 
> I get an error when trying to compile the following code:
> 
> test.h
> ------
> #include <libglademm/xml.h>
> #include <gtkmm>
> #include <iostream>
> 
> class Test
> {
>    Glib::RefPtr<Gnome::Glade::Xml> refXml;
>    Gtk::Window *pMWindow;
>    void on_quit_activate() { if (pMWindow) pMWindow->hide(); }
[snip]
>          pMenuItem->signal_activate().connect(
>            sigc::ptr_fun( &Test::on_quit_activate ) );

ptr_fun() is for static or global functions. You need mem_fun() for
member functions.

-- 
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]