I'm working on a gtkmm program and I would like to have a button that, when pressed, changes a given variable. For intensive purposes lets say I can't make this variable global. Is it still possible to call something like:
m_button2.signal_clicked().connect(sigc::ptr_fun(&on_player_button_clicked));
where on_player_button_clicked is the method that's called when button2 is pressed, but also pass it a parameter. So I want my button, when pressed, to call my method like this:
int parameter
m_button2.signal_clicked().connect(sigc::ptr_fun(&on_player_button_clicked(parameter)));
If this is not possible, is there any way for me to get my button to change this variable without making the variable global?