[9756] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] gtkmm signal/connect bug? insert_connection() in user class necessary?

daemon@ATHENA.MIT.EDU (Christof Petig)
Mon Nov 2 10:49:02 1998

Date: Mon, 02 Nov 1998 17:47:46 +0100
From: Christof Petig <christof.petig@wtal.de>
To: Gtk-List <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

This is a multi-part message in MIME format.
--------------CA3CC78EF0C4B9508931658D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

while compiling a really simple program with gtkmm signals (current CVS
and older versions checked) I ran into the strange requirement to have
insert_connection in each class connecting to signals.

This can't be right!

What and where's wrong?

  Christof

--------------CA3CC78EF0C4B9508931658D
Content-Type: text/plain; charset=us-ascii; name="sigtest.cc"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="sigtest.cc"

/*
g++ -g -Wall -DBE_CAREFUL -DDEBUG -I. -I/usr/development/lib/Gtk--/include -I/usr/X11R6/include -I/usr/development/lib/glib/include -I/usr/development/include   -c sigtest.cc -o sigtest.o
/usr/development/include/gtk--sigcpp.h: In function `class Connection connect_to_method<y, y, long int>(class Signal1<long int> &, class y *, void (y::*)(long int))':
sigtest.cc:13:   instantiated from here
/usr/development/include/gtk--sigcpp.h:481: no matching function for call to `y::insert_connection (Connection_impl *&)'
make: *** [sigtest.o] Error 1
*/

#include <gtk--sigcpp.h>

class x 
{public: 
   Signal1<long> test;
};

class y
{  x x_inst;
 public:
   void function(long y);
   y()
   {  connect_to_method(x_inst.test,this,&function);
   }
};


--------------CA3CC78EF0C4B9508931658D--

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post