C++ Gtkmm signal_connect with multiple arguments

Hello

I need to pass to function multiple GtkWidget* objects: for example 2 labels and 1 entry
to get text from entry and do some logic and put some outputs to label.

I checked docs but did not find any suggestion.
Can we pass a structure? If yes please provide simple solution or point me to example.

Thank you in advance.

sigc::bind is probably what you’re looking for. But if not, you will need to be more precise in your question.

Would it be correct then:

m_button1.signal_clicked().connect(
 sigc::bind(
            sigc::mem_fun(
                 *this, 
                  &on_button_clicked_func
            ), 
            label1,
            label2
     )
);


on_button_clicked_func(
    Gtk::Label label1,
    Gtk::Label label2
){
...
}

This is my guess. I need to find some examples. Gtk+ is completely different.

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