Re: Gtk widgets in gtkmm (Previously no subject)



Andrew Krause wrote:

(Sorry about the no subject topic... in any case...)

I have a c++ class that contains Gtk+ widgets. They work perfectly
fine except for one thing. When I try to connect a signal to them,
they throw an error saying that the function that it is connected
to should be formatted: "void (*) ()" instead of: "void (MyClass) ()".

How can I get around this? Is there a way without requiring all
of my functions to receive the class data and not be a part of
the class?

Put an & before the function name

signal_clicked().connect( sigc::mem_fun( *this, &Class::function ) );

No, no, you misunderstand. I am quite aware of how to connect a
signal with Gtkmm. My situation is that I am connecting a signal
with Gtk _in_ a c++ program using g_signal_connect. The problem
is that it throws an error because the function I am connecting
it to is part of a class. The only way I know how to fix this is
to take the function out of the class, but I do not want to do
this. - Andrew
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

you might could try making it a friend function of the class, but I'm not sure.



--
Jason Burchfield
CAS, Inc.
(256) 971-6096
Jason Burchfield cas-inc com




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