[gtkmm] Signal Connection Errors



Hey All,

I'm having some problems with signal connection.  I've asked on #C++,
and they seem to think my code should work.  Would someone be so kind
as to help me debug this?

Code Attached.  Compile error below.

Thanks for the help,

C.J.

Compile error:
---

In file included from /usr/include/sigc++-1.2/sigc++/object_slot.h:63:
/usr/include/sigc++-1.2/sigc++/object_slot.h: In constructor 
   `SigC::ObjectSlotNode::ObjectSlotNode(void (*)(void*), T*, void*, T2) [with 
   T = GenkaraToolbar, T2 = void (GenkaraToolbar::*)()]':
/usr/include/sigc++-1.2/sigc++/slot.h:211:   instantiated from `SigC::Slot0<R>::Slot0(SigC::SlotNode*) [with R = void]'
/usr/include/sigc++-1.2/sigc++/object_slot.h:63:   instantiated from `SigC::Slot0<R> SigC::slot(O1&, R (O2::*)()) [with R = void, O1 = GenkaraToolbar, O2 = GenkaraToolbar]'
toolbar.cc:37:   instantiated from here
/usr/include/sigc++-1.2/sigc++/object_slot.h:35: no matching function for call 
   to `SigC::ObjectSlotNode::init(GenkaraToolbar*&, void*&, void 
   (SigC::Object::*&)())'
/usr/include/sigc++-1.2/sigc++/object_slot.h:36: candidates are: void 
   SigC::ObjectSlotNode::init(SigC::Object*, void*, void (SigC::Object::*)())



/*
	Copyright (C) 2003 C.J. Collier (cjcollier colliertech org)

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

	See the GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to:
	
		Free Software Foundation, Inc.
		59 Temple Place - Suite 330
		Boston, MA  02111-1307, USA
*/

#include <iostream>

#include "toolbar.hh"

GenkaraToolbar::GenkaraToolbar(Glib::RefPtr<Gnome::Glade::Xml> ref_xml)
{
   // Get the buttons
   Gtk::Button
      *glade_new_button  = (Gtk::Button *)ref_xml->get_widget("new_button"),
      *glade_save_button = (Gtk::Button *)ref_xml->get_widget("save_button"),
      *glade_open_button = (Gtk::Button *)ref_xml->get_widget("open_button");

   // Connect signals
   glade_new_button->signal_clicked()
      .connect( SigC::slot(*this, &GenkaraToolbar::on_new_button_clicked) );
   glade_save_button->signal_clicked()
      .connect( SigC::slot(*this, &GenkaraToolbar::on_save_button_clicked) );
   glade_open_button->signal_clicked()
      .connect( SigC::slot(*this, &GenkaraToolbar::on_open_button_clicked) );
}

void
GenkaraToolbar::on_new_button_clicked()
{
   std::cout << "New Button Clicked" << std::endl;
}

void
GenkaraToolbar::on_open_button_clicked()
{
   std::cout << "Open Button Clicked" << std::endl;
}

void
GenkaraToolbar::on_save_button_clicked()
{
   std::cout << "Save Button Clicked" << std::endl;
}
/*
	Copyright (C) 2003 C.J. Collier (cjcollier colliertech org)

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

	See the GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to:
	
		Free Software Foundation, Inc.
		59 Temple Place - Suite 330
		Boston, MA  02111-1307, USA
*/

#ifndef _GENKARA_TOOLBAR_HH_
#define _GENKARA_TOOLBAR_HH_

#include <gtkmm.h>
#include <libgnomemm.h>
#include <libglademm/xml.h>

class GenkaraToolbar
{
public:
   GenkaraToolbar(Glib::RefPtr<Gnome::Glade::Xml> ref_xml);

   virtual void on_new_button_clicked();
   virtual void on_open_button_clicked();
   virtual void on_save_button_clicked();
};

#endif // _GENKARA_TOOLBAR_HH_


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