Re: event data / mmoorman



What kind of event data are you looking for? Also, what kind of signal are you handling?

If you need to bind some extra data to your callback, try using sigc::bind.

for example:

button1.signal_clicked().connect(sigc::bind(sigc::ptr_fun(&on_button_click), &button1));
button2.signal_clicked().connect(sigc::bind(sigc::ptr_fun(&on_button_click), &button2));

....

void on_button_clicked(Gtk::Button* btn) {

}

(Did not compile the above, please forgive any syntax errors)

You could use bind in a similar way in lieu of inspecting event data for a given signal.

Michael





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]