Callbacks and Signals works with Classes?



Hi!

I'm trying to create a class, this class defines a
button, on it's clicked signal it calls a callback
function that I want to put in the private part of the
class, but it returns me...

no matches converting function `on_button_clicked'
to type `void (*) ()'
clases.h:400: candidates are: void
myclass::on_button_clicked
()

The problem is; GTK_SIGNAL_FUNC is type void (*), and
my function is void... How can I call a funciton in
the same class?

class myclass
  {
    private:
      void on_button_clicked ()
         {
         }

    public:
       ...

       gtk_signal_connect (GTK_OBJECT (button),
                           "clicked",
                            GTK_SIGNAL_FUNC 
                            (on_button_clicked),
NULL);

  };

GTK Works with C++... am I right?

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




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