Re: [gtkmm] G++ throws a no matching function when I try to compile my C++



Am 26.08.2003 um 16:22 Uhr haben Sie geschrieben:
> when I try to compile my gtkmm using program g++
> throws me the following
> 
> mainWindow.cc: In constructor
> `MainWindow::MainWindow()':
> mainWindow.cc:13: no matching function for call to 
> `Glib::SignalProxy0<void>::
> connect(SigC::Slot1<void, MainWindow&>)'
> /usr/include/gtkmm-2.0/glibmm/signalproxy.h:113: 
> candidates are:
> SigC::Connection Glib::SignalProxy0<R>::connect(const >
SigC::Slot0<R>&, bool
> = true) [with R = void]
> 
> 
> the revelent code is:
> 
>
newGatewayButton.signal_clicked().connect(SigC::slot(&MainWindow::newGatewayPressed));
> 
> newGatewayButton is a button and I am trying to connect >
MainWindow::newGatewayPressed to the
> clicked signal of the button.
> 
> can someone please tell me what I did wrong?
> Thanks in advance

You must pass an object to SigC::slot()
(unless MainWindow::newGatewayPressed() is static):

e.g.

newGatewayButton.signal_clicked().connect(
  SigC::slot(*this, &MainWindow::newGatewayPressed));

Regards,

  Martin







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