Re: forwarding a signal



picca synchrotron-soleil fr wrote:
<snip>
  
Add a public function to your class:

sigc::connection AxeWidget::connect_change_signal(const
sigc::slot<void>& Slot)
{
  return m_spinbutton.signal_value_changed().connect(Slot);
}
    
<snip>
  
Use the public function cited above to connect your callback slot to your spin button's value_changed signal.

<code>
void my_callback(void)
{
    // do something here in response to spin button value change
}

AxeWidget myaxe;

myaxe.connect_change_signal(sigc::ptr_fun(&my_callback));
</code>

Hope this helps.

Bob Caryl


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