user data in signals
- From: Christopher Harvey <chris basementcode com>
- To: gtkmm-list gnome org
- Subject: user data in signals
- Date: Sun, 14 Jun 2009 19:14:33 -0400
I've got a button signal handler, so it takes no parameters. I was
wondering if there was some way I could send "user data" when the signal
is connected.
something like this:
void handlePress(int buttonID) {
//I use buttonID here
}
int main() {
b1.signal_clicked().connect(ptr_fun(handlePress(1)));
b2.signal_clicked().connect(ptr_fun(handlePress(2)));
b3.signal_clicked().connect(ptr_fun(handlePress(3)));
}
Doesn't plain gtk support something like this?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]