Signal_button_press_event not working for gtk notebook tab label

I want to call a function, when user clicks on the GtkLabel(tab child) created when creating the GtkNotebook.

Declared the label like

Gtk::Label *someInfoTabLabel;

Declared the function to be called

void someInfoTabLabelClicked();

I connected the label from the glade file to the programming through

builder->get_widget("someInfoTab"+someStringValue,someInfoTabLabel);

I try to called a function the the user clicks on the label tab of the notebook through this line

someInfoTabLabel->signal_button_press_event().connect(sigc::mem_fun(*this,&myClass::sometInfoTabLabelClicked));

Gtk Notebook documentation mentions in signals inherited from gtk::button as Gtk.Widget::button-press-event can be used.

I get this error

required from here
/usr/include/sigc++-2.0/sigc++/functors/slot.h:170:20: error: void value not ignored as it ought to be
                (a_1);

 required from here
/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89:30: error: no match for call to ??(sigc::bound_mem_functor0<void, myClass>) (_GdkEventButton* const&)??
     { return functor_(_A_arg1); }

/usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
     { return functor_(_A_arg1); }

What’s going wrong here?
If this approach is wrong, then how to I make a function run on the notebook tab label clicked by the user?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.