Re: Signal to other class



Yes you just need a pointer or reference to an instance of FunctionA, like this:

....
FunctionA * instance = new FunctionA;
...

FunctionB::FunctionB()
{   
...
  button.signal_clicked().connect(sigc::mem_fun( *instance, &FunctionA::onButtonClick ));
...
}



2008/8/6 Paulo Flabiano Smorigo <pfsmorigo gmail com>
Hi everyone,

I'm new with this signal stuff and maybe I'm zone out but is it possible to create a signal that calls a function from other class?

Like that:

FunctionB::FunctionB()
{   
...
  button.signal_clicked().connect(sigc::mem_fun(*this, &FunctionA::onButtonClick));
...
}


FunctionA::FunctionA()
{   
...
...
}

FunctionA::onButtonClick()
{   
   std::ccout  << "TESTE" << std:endl;
}

--
P.F.Smorigo

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]


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