I have 4 buttons to add and fill a Gtk::Box to a grid, instead of having 4 different functions for essentially the same operation I would like to pass a value to the function and use if statements to fill the box depending on which button is pressed.
Header file:
Gtk::Button tAdd, pAdd, dAdd, bAdd;
void card_add(int columnChoice);
Source file:
tAdd.signal_clicked().connect(sigc::mem_fun(*this, &tabs::card_add(1)));
pAdd.signal_clicked().connect(sigc::mem_fun(*this, &tabs::card_add(2)));
dAdd.signal_clicked().connect(sigc::mem_fun(*this, &tabs::card_add(3)));
bAdd.signal_clicked().connect(sigc::mem_fun(*this, &tabs::card_add(4)));
void tabs::card_add(int columnChoice) {
std::cout << columnChoice << std::endl;
}
The error I receive:
error: lvalue required as unary ‘&’ operand