Re: forwarding a signal



On Wed, 2006-08-02 at 11:52 +0200, picca synchrotron-soleil fr wrote:
> Hello
> 
> I created a widget like this:
> 
> class AxeWidget : public Gtk::VBox
> {
>   public:
>     AxeWidget(hkl::Axe & axe);
>     virtual ~AxeWidget(void);
>     void update(bool const & connect);
>   
>   protected:
> 
>     virtual void on_spinbutton_value_changed();
> 
>     hkl::Axe & m_axe;
> 
>     Gtk::Label m_label;
>     Gtk::SpinButton m_spinbutton;
>     sigc::connection m_on_value_changed;
> };
> 
> I would like for another class to connect to a signal AxeWidget.signal_value_changed() with is in fact the m_spinbutton.signal_value_changed().
> How can I proceed ?

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);
}

Cheers,
Tim




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